library(Seurat)
The legacy packages maptools, rgdal, and rgeos, underpinning this package
will retire shortly. Please refer to R-spatial evolution reports on
https://r-spatial.org/r/2023/05/15/evolution4.html for details.
This package is now running under evolution status 0 
Registered S3 method overwritten by 'data.table':
  method           from
  print.data.table     
Registered S3 method overwritten by 'htmlwidgets':
  method           from         
  print.htmlwidget tools:rstudio
Attaching SeuratObject
Warning message:
R graphics engine version 15 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed. 
library(tidyverse)
Registered S3 methods overwritten by 'dbplyr':
  method         from
  print.tbl_lazy     
  print.tbl_sql      
── Attaching packages ───────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.2     ✔ purrr   1.0.1
✔ tibble  3.2.1     ✔ dplyr   1.1.2
✔ tidyr   1.3.0     ✔ stringr 1.5.0
✔ readr   2.1.3     ✔ forcats 0.5.2
── Conflicts ──────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
#library(CelltypeR)
samples
 [1] "NPC3383"        "NPC3383-iso"    "NPC3575"        "NPC3575-iso"   
 [5] "NPC3595"        "NPC3595-iso"    "NPC3940"        "NPC3940N-iso"  
 [9] "NPC2965"        "NPC3567"        "NPC3567-iso"    "NPCTD06"       
[13] "NPCTD07"        "NPC3448"        "NPCTD06-iso"    "NPC3123"       
[17] "NPCQ65Q"        "NPCAIW002-02"   "NPC3940R-iso"   "Final3123"     
[21] "FinalP65P"      "FinalQ65Q"      "NPCP65P"        "Final3383-iso" 
[25] "Final3575-iso"  "Final3595"      "Final3595-iso"  "Final3940"     
[29] "Final3940N-iso" "Final3567"      "NPCAIW001-02"   "NPC2AIW002-02" 
[33] "NPCTD22"        "FinalAIW001-02" "FinalAIW002-02" "FinalTD07"     
[37] "M1"             "M2"             "M3"             "M4"            
[41] "M5"             "M6"             "M7"             "M8"            
[45] "POOL_1NPC"      "POOL_2NPC"      "POOL_3NPC"      "POOL_4Final"   

Add meta data information

DimPlot(seu)

# check with sample names

table(seu$sample, seu$CultureType)
                
                  NPC Neurons2weeks MotorNeurons
  Final3123         0           796            0
  Final3383-iso     0          1008            0
  Final3567         0           940            0
  Final3575-iso     0          1221            0
  Final3595         0          1302            0
  Final3595-iso     0          1546            0
  Final3940         0          1643            0
  Final3940N-iso    0          1238            0
  FinalAIW001-02    0          1712            0
  FinalAIW002-02    0          1439            0
  FinalP65P         0          1709            0
  FinalQ65Q         0          2739            0
  FinalTD07         0          1032            0
  M1                0             0         1290
  M2                0             0         1627
  M3                0             0         2463
  M4                0             0         1883
  M5                0             0         8202
  M6                0             0         1160
  M7                0             0         1968
  M8                0             0         1215
  NPC2965         279             0            0
  NPC2AIW002-02  1478             0            0
  NPC3123         512             0            0
  NPC3383         800             0            0
  NPC3383-iso    1030             0            0
  NPC3448        1922             0            0
  NPC3567         920             0            0
  NPC3567-iso    1372             0            0
  NPC3575         155             0            0
  NPC3575-iso    1998             0            0
  NPC3595         798             0            0
  NPC3595-iso    1300             0            0
  NPC3940         414             0            0
  NPC3940N-iso    846             0            0
  NPC3940R-iso   1105             0            0
  NPCAIW001-02   1252             0            0
  NPCAIW002-02   1840             0            0
  NPCP65P        1146             0            0
  NPCQ65Q         862             0            0
  NPCTD06        1432             0            0
  NPCTD06-iso     591             0            0
  NPCTD07        1083             0            0
  NPCTD22        1507             0            0
  POOL_1NPC       876             0            0
  POOL_2NPC       204             0            0
  POOL_3NPC      1218             0            0
  POOL_4Final       0           977            0

Add the lines and then the diseases status


seu <- annotate(seu, annotations = new_line_vector, to_label = "sample",annotation_name = "Line")

DimPlot(seu)


# check
table(seu$sample, seu$Line)
                
                 3383 3383-iso 3575 3575-iso 3595 3595-iso 3940 3940N-iso
  Final3123         0        0    0        0    0        0    0         0
  Final3383-iso     0     1008    0        0    0        0    0         0
  Final3567         0        0    0        0    0        0    0         0
  Final3575-iso     0        0    0     1221    0        0    0         0
  Final3595         0        0    0        0 1302        0    0         0
  Final3595-iso     0        0    0        0    0     1546    0         0
  Final3940         0        0    0        0    0        0 1643         0
  Final3940N-iso    0        0    0        0    0        0    0      1238
  FinalAIW001-02    0        0    0        0    0        0    0         0
  FinalAIW002-02    0        0    0        0    0        0    0         0
  FinalP65P         0        0    0        0    0        0    0         0
  FinalQ65Q         0        0    0        0    0        0    0         0
  FinalTD07         0        0    0        0    0        0    0         0
  M1                0        0    0        0    0        0    0         0
  M2                0        0    0        0    0        0    0         0
  M3                0        0    0        0    0        0    0         0
  M4                0        0    0        0    0        0    0         0
  M5                0        0    0        0    0        0    0         0
  M6                0        0    0        0    0        0    0         0
  M7                0        0    0        0    0        0    0         0
  M8                0        0    0        0    0        0    0         0
  NPC2965           0        0    0        0    0        0    0         0
  NPC2AIW002-02     0        0    0        0    0        0    0         0
  NPC3123           0        0    0        0    0        0    0         0
  NPC3383         800        0    0        0    0        0    0         0
  NPC3383-iso       0     1030    0        0    0        0    0         0
  NPC3448           0        0    0        0    0        0    0         0
  NPC3567           0        0    0        0    0        0    0         0
  NPC3567-iso       0        0    0        0    0        0    0         0
                
                 2965 3567 3567-iso TD06 TD07 3448 TD06-iso 3123-iso
  Final3123         0    0        0    0    0    0        0      796
  Final3383-iso     0    0        0    0    0    0        0        0
  Final3567         0  940        0    0    0    0        0        0
  Final3575-iso     0    0        0    0    0    0        0        0
  Final3595         0    0        0    0    0    0        0        0
  Final3595-iso     0    0        0    0    0    0        0        0
  Final3940         0    0        0    0    0    0        0        0
  Final3940N-iso    0    0        0    0    0    0        0        0
  FinalAIW001-02    0    0        0    0    0    0        0        0
  FinalAIW002-02    0    0        0    0    0    0        0        0
  FinalP65P         0    0        0    0    0    0        0        0
  FinalQ65Q         0    0        0    0    0    0        0        0
  FinalTD07         0    0        0    0 1032    0        0        0
  M1                0    0        0    0    0    0        0        0
  M2                0    0        0    0    0    0        0        0
  M3                0    0        0    0    0    0        0        0
  M4                0    0        0    0    0    0        0        0
  M5                0    0        0    0    0    0        0        0
  M6                0    0        0    0    0    0        0        0
  M7                0    0        0    0    0    0        0        0
  M8                0    0        0    0    0    0        0        0
  NPC2965         279    0        0    0    0    0        0        0
  NPC2AIW002-02     0    0        0    0    0    0        0        0
  NPC3123           0    0        0    0    0    0        0      512
  NPC3383           0    0        0    0    0    0        0        0
  NPC3383-iso       0    0        0    0    0    0        0        0
  NPC3448           0    0        0    0    0 1922        0        0
  NPC3567           0  920        0    0    0    0        0        0
  NPC3567-iso       0    0     1372    0    0    0        0        0
                
                 3123-isoQ65Q AIW002-02 3940R-iso 3123-isoP65P AIW001-02
  Final3123                 0         0         0            0         0
  Final3383-iso             0         0         0            0         0
  Final3567                 0         0         0            0         0
  Final3575-iso             0         0         0            0         0
  Final3595                 0         0         0            0         0
  Final3595-iso             0         0         0            0         0
  Final3940                 0         0         0            0         0
  Final3940N-iso            0         0         0            0         0
  FinalAIW001-02            0         0         0            0      1712
  FinalAIW002-02            0      1439         0            0         0
  FinalP65P                 0         0         0         1709         0
  FinalQ65Q              2739         0         0            0         0
  FinalTD07                 0         0         0            0         0
  M1                        0         0         0            0         0
  M2                        0         0         0            0         0
  M3                        0         0         0            0         0
  M4                        0         0         0            0         0
  M5                        0         0         0            0         0
  M6                        0         0         0            0         0
  M7                        0         0         0            0         0
  M8                        0         0         0            0         0
  NPC2965                   0         0         0            0         0
  NPC2AIW002-02             0      1478         0            0         0
  NPC3123                   0         0         0            0         0
  NPC3383                   0         0         0            0         0
  NPC3383-iso               0         0         0            0         0
  NPC3448                   0         0         0            0         0
  NPC3567                   0         0         0            0         0
  NPC3567-iso               0         0         0            0         0
                
                 TD22   M1   M2   M3   M4   M5   M6   M7   M8 POOL_1NPC
  Final3123         0    0    0    0    0    0    0    0    0         0
  Final3383-iso     0    0    0    0    0    0    0    0    0         0
  Final3567         0    0    0    0    0    0    0    0    0         0
  Final3575-iso     0    0    0    0    0    0    0    0    0         0
  Final3595         0    0    0    0    0    0    0    0    0         0
  Final3595-iso     0    0    0    0    0    0    0    0    0         0
  Final3940         0    0    0    0    0    0    0    0    0         0
  Final3940N-iso    0    0    0    0    0    0    0    0    0         0
  FinalAIW001-02    0    0    0    0    0    0    0    0    0         0
  FinalAIW002-02    0    0    0    0    0    0    0    0    0         0
  FinalP65P         0    0    0    0    0    0    0    0    0         0
  FinalQ65Q         0    0    0    0    0    0    0    0    0         0
  FinalTD07         0    0    0    0    0    0    0    0    0         0
  M1                0 1290    0    0    0    0    0    0    0         0
  M2                0    0 1627    0    0    0    0    0    0         0
  M3                0    0    0 2463    0    0    0    0    0         0
  M4                0    0    0    0 1883    0    0    0    0         0
  M5                0    0    0    0    0 8202    0    0    0         0
  M6                0    0    0    0    0    0 1160    0    0         0
  M7                0    0    0    0    0    0    0 1968    0         0
  M8                0    0    0    0    0    0    0    0 1215         0
  NPC2965           0    0    0    0    0    0    0    0    0         0
  NPC2AIW002-02     0    0    0    0    0    0    0    0    0         0
  NPC3123           0    0    0    0    0    0    0    0    0         0
  NPC3383           0    0    0    0    0    0    0    0    0         0
  NPC3383-iso       0    0    0    0    0    0    0    0    0         0
  NPC3448           0    0    0    0    0    0    0    0    0         0
  NPC3567           0    0    0    0    0    0    0    0    0         0
  NPC3567-iso       0    0    0    0    0    0    0    0    0         0
                
                 POOL_2NPC POOL_3NPC POOL_4Final
  Final3123              0         0           0
  Final3383-iso          0         0           0
  Final3567              0         0           0
  Final3575-iso          0         0           0
  Final3595              0         0           0
  Final3595-iso          0         0           0
  Final3940              0         0           0
  Final3940N-iso         0         0           0
  FinalAIW001-02         0         0           0
  FinalAIW002-02         0         0           0
  FinalP65P              0         0           0
  FinalQ65Q              0         0           0
  FinalTD07              0         0           0
  M1                     0         0           0
  M2                     0         0           0
  M3                     0         0           0
  M4                     0         0           0
  M5                     0         0           0
  M6                     0         0           0
  M7                     0         0           0
  M8                     0         0           0
  NPC2965                0         0           0
  NPC2AIW002-02          0         0           0
  NPC3123                0         0           0
  NPC3383                0         0           0
  NPC3383-iso            0         0           0
  NPC3448                0         0           0
  NPC3567                0         0           0
  NPC3567-iso            0         0           0
 [ reached getOption("max.print") -- omitted 19 rows ]
DimPlot(seu)

# add disease status

# Create the lookup table for Line to DiseaseStatus mapping
line_to_disease <- c("3448" = "HC",
                     "TD22" = "HC",
                     "AIW001-02" = "HC",
                     "AIW002-02" = "HC",
                     "2965" = "PD",
                     "3383" = "PD",
                     "3575" = "PD",
                     "TD06" = "PD",
                     "TD07" = "PD",
                     "3123" = "PD",
                     "3567" = "PD",
                     "3595" = "PD",
                     "3940" = "PD",
                     "3567-iso" = "PD-iso",
                     "3940R-iso" = "PD-iso",
                     "TD06-iso" = "PD-iso",
                     "3940N-iso" = "PD-iso",
                     "3123-isoQ65Q" = "PD-iso",
                     "3123-isoP65P" = "PD-iso",
                     "3123-iso" = "PD-iso",
                     "3383-iso" = "PD-iso",
                     "3575-iso" = "PD-iso",
                     "3595-iso" = "PD-iso")

# Assuming "Line" is your starting character vector
Idents(seu) <- "Line"
Line <- levels(seu)
# Create a new vector of disease statuses using the lookup table
disease_status_vector <- ifelse(Line %in% names(line_to_disease), 
                                line_to_disease[Line], 
                                "other")

# Print the new vector of disease statuses
print(disease_status_vector)
 [1] "PD"     "PD-iso" "PD"     "PD-iso" "PD"     "PD-iso" "PD"    
 [8] "PD-iso" "PD"     "PD"     "PD-iso" "PD"     "PD"     "HC"    
[15] "PD-iso" "PD-iso" "PD-iso" "HC"     "PD-iso" "PD-iso" "HC"    
[22] "HC"     "other"  "other"  "other"  "other"  "other"  "other" 
[29] "other"  "other"  "other"  "other"  "other"  "other" 
seu <- annotate(seu, annotations = disease_status_vector, to_label = "Line",annotation_name = "DiseaseStatus")


# check
table(seu$Line, seu$DiseaseStatus)
              
                 PD PD-iso   HC other
  3383          800      0    0     0
  3383-iso        0   2038    0     0
  3575          155      0    0     0
  3575-iso        0   3219    0     0
  3595         2100      0    0     0
  3595-iso        0   2846    0     0
  3940         2057      0    0     0
  3940N-iso       0   2084    0     0
  2965          279      0    0     0
  3567         1860      0    0     0
  3567-iso        0   1372    0     0
  TD06         1432      0    0     0
  TD07         2115      0    0     0
  3448            0      0 1922     0
  TD06-iso        0    591    0     0
  3123-iso        0   1308    0     0
  3123-isoQ65Q    0   3601    0     0
  AIW002-02       0      0 4757     0
  3940R-iso       0   1105    0     0
  3123-isoP65P    0   2855    0     0
  AIW001-02       0      0 2964     0
  TD22            0      0 1507     0
  M1              0      0    0  1290
  M2              0      0    0  1627
  M3              0      0    0  2463
  M4              0      0    0  1883
  M5              0      0    0  8202
  M6              0      0    0  1160
  M7              0      0    0  1968
  M8              0      0    0  1215
  POOL_1NPC       0      0    0   876
  POOL_2NPC       0      0    0   204
  POOL_3NPC       0      0    0  1218
  POOL_4Final     0      0    0   977
table(sample)
Error in unique.default(x, nmax = nmax) : 
  unique() applies only to vectors
cellcounts <- as.data.frame(table(seu$Line,seu$CultureType))
table(seu$Line,seu$CultureType,seu$DiseaseStatus)
, ,  = PD

              
                NPC Neurons2weeks MotorNeurons
  3383          800             0            0
  3383-iso        0             0            0
  3575          155             0            0
  3575-iso        0             0            0
  3595          798          1302            0
  3595-iso        0             0            0
  3940          414          1643            0
  3940N-iso       0             0            0
  2965          279             0            0
  3567          920           940            0
  3567-iso        0             0            0
  TD06         1432             0            0
  TD07         1083          1032            0
  3448            0             0            0
  TD06-iso        0             0            0
  3123-iso        0             0            0
  3123-isoQ65Q    0             0            0
  AIW002-02       0             0            0
  3940R-iso       0             0            0
  3123-isoP65P    0             0            0
  AIW001-02       0             0            0
  TD22            0             0            0
  M1              0             0            0
  M2              0             0            0
  M3              0             0            0
  M4              0             0            0
  M5              0             0            0
  M6              0             0            0
  M7              0             0            0
  M8              0             0            0
  POOL_1NPC       0             0            0
  POOL_2NPC       0             0            0
  POOL_3NPC       0             0            0
  POOL_4Final     0             0            0

, ,  = PD-iso

              
                NPC Neurons2weeks MotorNeurons
  3383            0             0            0
  3383-iso     1030          1008            0
  3575            0             0            0
  3575-iso     1998          1221            0
  3595            0             0            0
  3595-iso     1300          1546            0
  3940            0             0            0
  3940N-iso     846          1238            0
  2965            0             0            0
  3567            0             0            0
  3567-iso     1372             0            0
  TD06            0             0            0
  TD07            0             0            0
  3448            0             0            0
  TD06-iso      591             0            0
  3123-iso      512           796            0
  3123-isoQ65Q  862          2739            0
  AIW002-02       0             0            0
  3940R-iso    1105             0            0
  3123-isoP65P 1146          1709            0
  AIW001-02       0             0            0
  TD22            0             0            0
  M1              0             0            0
  M2              0             0            0
  M3              0             0            0
  M4              0             0            0
  M5              0             0            0
  M6              0             0            0
  M7              0             0            0
  M8              0             0            0
  POOL_1NPC       0             0            0
  POOL_2NPC       0             0            0
  POOL_3NPC       0             0            0
  POOL_4Final     0             0            0

, ,  = HC

              
                NPC Neurons2weeks MotorNeurons
  3383            0             0            0
  3383-iso        0             0            0
  3575            0             0            0
  3575-iso        0             0            0
  3595            0             0            0
  3595-iso        0             0            0
  3940            0             0            0
  3940N-iso       0             0            0
  2965            0             0            0
  3567            0             0            0
  3567-iso        0             0            0
  TD06            0             0            0
  TD07            0             0            0
  3448         1922             0            0
  TD06-iso        0             0            0
  3123-iso        0             0            0
  3123-isoQ65Q    0             0            0
  AIW002-02    3318          1439            0
  3940R-iso       0             0            0
  3123-isoP65P    0             0            0
  AIW001-02    1252          1712            0
  TD22         1507             0            0
  M1              0             0            0
  M2              0             0            0
  M3              0             0            0
  M4              0             0            0
  M5              0             0            0
  M6              0             0            0
  M7              0             0            0
  M8              0             0            0
  POOL_1NPC       0             0            0
  POOL_2NPC       0             0            0
  POOL_3NPC       0             0            0
  POOL_4Final     0             0            0

, ,  = other

              
                NPC Neurons2weeks MotorNeurons
  3383            0             0            0
  3383-iso        0             0            0
  3575            0             0            0
  3575-iso        0             0            0
  3595            0             0            0
  3595-iso        0             0            0
  3940            0             0            0
  3940N-iso       0             0            0
  2965            0             0            0
  3567            0             0            0
  3567-iso        0             0            0
  TD06            0             0            0
  TD07            0             0            0
  3448            0             0            0
  TD06-iso        0             0            0
  3123-iso        0             0            0
  3123-isoQ65Q    0             0            0
  AIW002-02       0             0            0
  3940R-iso       0             0            0
  3123-isoP65P    0             0            0
  AIW001-02       0             0            0
  TD22            0             0            0
  M1              0             0         1290
  M2              0             0         1627
  M3              0             0         2463
  M4              0             0         1883
  M5              0             0         8202
  M6              0             0         1160
  M7              0             0         1968
  M8              0             0         1215
  POOL_1NPC     876             0            0
  POOL_2NPC     204             0            0
  POOL_3NPC    1218             0            0
  POOL_4Final     0           977            0
# Convert long_df to the wide format
wide_df <- pivot_wider(cellcounts, 
                       id_cols = Var1, 
                       names_from = Var2, 
                       values_from = Freq)

write.csv(wide_df,"cellcounts_sample.csv")
DimPlot(seu, group.by = "DiseaseStatus")

Subset for to remove pools and Maria’s samples

Reprocess subset

seu.n <- readRDS("/Users/rhalenathomas/Documents/Data/scRNAseq/ParseExample/Ex2_48well/ParseNCADDsamples.RDS")
  

Get clusters

Subset out neurons and NPC


#seu.n$CultureType
Idents(seu.n) <- "CultureType"
neurons <- subset(seu.n, idents = "Neurons2weeks")

DimPlot(seu)
DimPlot(seu, group.by = "CultureType")

DimPlot(seu, group.by = "Line")

Integration

save objects


saveRDS(seu, "/Users/rhalenathomas/Documents/Data/scRNAseq/ParseExample/Ex2_48well/Parse48_allSamples.RDS")

saveRDS(seu.n, "/Users/rhalenathomas/Documents/Data/scRNAseq/ParseExample/Ex2_48well/ParseNCADDsamples.RDS")
table(NPC$DiseaseStatus,NPC$Line)
        
         3383 3383-iso 3575 3575-iso 3595 3595-iso 3940 3940N-iso 2965 3567
  PD      800        0  155        0  798        0  414         0  279  920
  PD-iso    0     1030    0     1998    0     1300    0       846    0    0
  HC        0        0    0        0    0        0    0         0    0    0
  other     0        0    0        0    0        0    0         0    0    0
        
         3567-iso TD06 TD07 3448 TD06-iso 3123-iso 3123-isoQ65Q AIW002-02
  PD            0 1432 1083    0        0        0            0         0
  PD-iso     1372    0    0    0      591      512          862         0
  HC            0    0    0 1922        0        0            0      3318
  other         0    0    0    0        0        0            0         0
        
         3940R-iso 3123-isoP65P AIW001-02 TD22   M1   M2   M3   M4   M5   M6
  PD             0            0         0    0    0    0    0    0    0    0
  PD-iso      1105         1146         0    0    0    0    0    0    0    0
  HC             0            0      1252 1507    0    0    0    0    0    0
  other          0            0         0    0    0    0    0    0    0    0
        
           M7   M8 POOL_1NPC POOL_2NPC POOL_3NPC POOL_4Final
  PD        0    0         0         0         0           0
  PD-iso    0    0         0         0         0           0
  HC        0    0         0         0         0           0
  other     0    0         0         0         0           0

Now integrate samples

sublist <- SplitObject(NPC.PDiso, split.by = "Line")
# normalize and find variable features
for (i in 1:length(sublist)){
  sublist[[i]] <- NormalizeData(sublist[[i]], verbose = FALSE)
  sublist[[i]] <- FindVariableFeatures(sublist[[i]], selection.method = "vst")
}
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
# Create an empty Seurat object to store the integrated data
# Take the first Seurat object from the list as the starting point
integrated_seurat <- subset(sublist[[1]])
# Iterate over the list of Seurat objects
for (i in 1:length(sublist)) {
  # Rename the 'orig.ident' metadata inside the seurat object to match the object name in the list
  sublist[[i]]$orig.ident <- names(sublist)[i]

}
sample.list <- sublist
for (i in 1:length(sample.list)) {
  # Normalize and scale the data
  sample.list[[i]] <- NormalizeData(sample.list[[i]], verbose = FALSE)
  sample.list[[i]] <- ScaleData(sample.list[[i]], verbose = FALSE)
  # Find variable features
  sample.list[[i]] <- FindVariableFeatures(sample.list[[i]], selection.method = "vst")
  # Get the variable features
  variable_features <- VariableFeatures(sample.list[[i]])
  # Run PCA with the variable features
  sample.list[[i]] <- RunPCA(sample.list[[i]], verbose = FALSE, npcs = 30, features = variable_features)
}
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
int.anchors <- FindIntegrationAnchors(object.list = sample.list, dims = 1:30, reduction = "rpca")
Computing 2000 integration features
Scaling features for provided objects

  |                                                  | 0 % ~calculating  
  |+++++                                             | 10% ~01s          
  |++++++++++                                        | 20% ~02s          
  |+++++++++++++++                                   | 30% ~01s          
  |++++++++++++++++++++                              | 40% ~01s          
  |+++++++++++++++++++++++++                         | 50% ~01s          
  |++++++++++++++++++++++++++++++                    | 60% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02s  
Computing within dataset neighborhoods

  |                                                  | 0 % ~calculating  
  |+++++                                             | 10% ~02s          
  |++++++++++                                        | 20% ~03s          
  |+++++++++++++++                                   | 30% ~02s          
  |++++++++++++++++++++                              | 40% ~02s          
  |+++++++++++++++++++++++++                         | 50% ~02s          
  |++++++++++++++++++++++++++++++                    | 60% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=03s  
Finding all pairwise anchors

  |                                                  | 0 % ~calculating  
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 866 anchors

  |++                                                | 2 % ~01m 33s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 511 anchors

  |+++                                               | 4 % ~01m 24s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1437 anchors

  |++++                                              | 7 % ~01m 27s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 547 anchors

  |+++++                                             | 9 % ~01m 20s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1525 anchors

  |++++++                                            | 11% ~01m 19s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1309 anchors

  |+++++++                                           | 13% ~01m 15s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1008 anchors

  |++++++++                                          | 16% ~01m 13s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 657 anchors

  |+++++++++                                         | 18% ~01m 13s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 484 anchors

  |++++++++++                                        | 20% ~01m 11s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 483 anchors

  |++++++++++++                                      | 22% ~01m 08s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 825 anchors

  |+++++++++++++                                     | 24% ~01m 05s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 569 anchors

  |++++++++++++++                                    | 27% ~01m 03s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 400 anchors

  |+++++++++++++++                                   | 29% ~01m 01s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 434 anchors

  |++++++++++++++++                                  | 31% ~57s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 930 anchors

  |+++++++++++++++++                                 | 33% ~55s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 538 anchors

  |++++++++++++++++++                                | 36% ~52s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1306 anchors

  |+++++++++++++++++++                               | 38% ~51s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 654 anchors

  |++++++++++++++++++++                              | 40% ~49s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 712 anchors

  |++++++++++++++++++++++                            | 42% ~46s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 489 anchors

  |+++++++++++++++++++++++                           | 44% ~44s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 434 anchors

  |++++++++++++++++++++++++                          | 47% ~42s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 561 anchors

  |+++++++++++++++++++++++++                         | 49% ~40s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1752 anchors

  |++++++++++++++++++++++++++                        | 51% ~38s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 961 anchors

  |+++++++++++++++++++++++++++                       | 53% ~37s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1183 anchors

  |++++++++++++++++++++++++++++                      | 56% ~35s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 512 anchors

  |+++++++++++++++++++++++++++++                     | 58% ~33s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 449 anchors

  |++++++++++++++++++++++++++++++                    | 60% ~31s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 887 anchors

  |++++++++++++++++++++++++++++++++                  | 62% ~29s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 897 anchors

  |+++++++++++++++++++++++++++++++++                 | 64% ~27s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 689 anchors

  |++++++++++++++++++++++++++++++++++                | 67% ~26s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 461 anchors

  |+++++++++++++++++++++++++++++++++++               | 69% ~24s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 502 anchors

  |++++++++++++++++++++++++++++++++++++              | 71% ~22s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1401 anchors

  |+++++++++++++++++++++++++++++++++++++             | 73% ~21s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 868 anchors

  |++++++++++++++++++++++++++++++++++++++            | 76% ~19s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 470 anchors

  |+++++++++++++++++++++++++++++++++++++++           | 78% ~17s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 527 anchors

  |++++++++++++++++++++++++++++++++++++++++          | 80% ~15s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 753 anchors

  |++++++++++++++++++++++++++++++++++++++++++        | 82% ~14s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 2282 anchors

  |+++++++++++++++++++++++++++++++++++++++++++       | 84% ~12s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1102 anchors

  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~10s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1239 anchors

  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~09s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 682 anchors

  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~07s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 558 anchors

  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~05s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1248 anchors

  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~03s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1479 anchors

  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~02s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 680 anchors

  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 18s
integrated_seurat <- IntegrateData(anchorset = int.anchors,  dims = 1:30)
Merging dataset 7 into 2
Extracting anchors for merged samples
Finding integration vectors
Finding integration vector weights
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Integrating data
Merging dataset 10 into 2 7
Extracting anchors for merged samples
Finding integration vectors
Finding integration vector weights
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Integrating data
Merging dataset 8 into 2 7 10
Extracting anchors for merged samples
Finding integration vectors
Finding integration vector weights
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Integrating data
Merging dataset 6 into 5
Extracting anchors for merged samples
Finding integration vectors
Finding integration vector weights
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Integrating data
Merging dataset 4 into 3
Extracting anchors for merged samples
Finding integration vectors
Finding integration vector weights
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Integrating data
Merging dataset 9 into 5 6
Extracting anchors for merged samples
Finding integration vectors
Finding integration vector weights
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Integrating data
Merging dataset 3 4 into 2 7 10 8
Extracting anchors for merged samples
Finding integration vectors
Finding integration vector weights
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Integrating data
Merging dataset 1 into 5 6 9
Extracting anchors for merged samples
Finding integration vectors
Finding integration vector weights
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Integrating data
Merging dataset 5 6 9 1 into 2 7 10 8 3 4
Extracting anchors for merged samples
Finding integration vectors
Finding integration vector weights
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Integrating data
int.PDiso <- integrated_seurat
Idents(int.PDiso) <- "Line"
levels(int.PDiso)
 [1] "3383-iso"     "3575-iso"     "3595-iso"     "3940N-iso"   
 [5] "3567-iso"     "TD06-iso"     "3123-iso"     "3123-isoQ65Q"
 [9] "3940R-iso"    "3123-isoP65P"
# an integrate funcrion

# Define a function for integrating a list of Seurat objects
integrate_seurat_objects <- function(seurat_list, dims = 1:30) {
  # Normalize and find variable features for each object
  for (i in 1:length(seurat_list)) {
    seurat_list[[i]] <- NormalizeData(seurat_list[[i]], verbose = FALSE)
    seurat_list[[i]] <- FindVariableFeatures(seurat_list[[i]], selection.method = "vst")
  }

  # Create an empty Seurat object to store the integrated data
  integrated_seurat <- subset(seurat_list[[1]])

  # Iterate over the list of Seurat objects
  for (i in 1:length(seurat_list)) {
    # Rename the 'orig.ident' metadata inside the Seurat object to match the object name in the list
    seurat_list[[i]]$orig.ident <- names(seurat_list)[i]
  }

  sample.list <- seurat_list
  for (i in 1:length(sample.list)) {
    # Normalize and scale the data
    sample.list[[i]] <- NormalizeData(sample.list[[i]], verbose = FALSE)
    sample.list[[i]] <- ScaleData(sample.list[[i]], verbose = FALSE)
    # Find variable features
    sample.list[[i]] <- FindVariableFeatures(sample.list[[i]], selection.method = "vst")
    # Get the variable features
    variable_features <- VariableFeatures(sample.list[[i]])
    # Run PCA with the variable features
    sample.list[[i]] <- RunPCA(sample.list[[i]], verbose = FALSE, npcs = 30, features = variable_features)
  }

  # Find integration anchors
  int.anchors <- FindIntegrationAnchors(object.list = sample.list, dims = dims, reduction = "rpca")

  # Integrate data
  integrated_seurat <- IntegrateData(anchorset = int.anchors, dims = dims)

  return(integrated_seurat)
}

Use function to integrate the HC

sublist <- SplitObject(NPC.PDiso, split.by = "Line")

int.iso <- integrate_seurat_objects(sublist, dims = 1:30)
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Computing 2000 integration features
Scaling features for provided objects

  |                                                  | 0 % ~calculating  
  |+++++                                             | 10% ~02s          
  |++++++++++                                        | 20% ~02s          
  |+++++++++++++++                                   | 30% ~02s          
  |++++++++++++++++++++                              | 40% ~02s          
  |+++++++++++++++++++++++++                         | 50% ~02s          
  |++++++++++++++++++++++++++++++                    | 60% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=03s  
Computing within dataset neighborhoods

  |                                                  | 0 % ~calculating  
  |+++++                                             | 10% ~02s          
  |++++++++++                                        | 20% ~03s          
  |+++++++++++++++                                   | 30% ~03s          
  |++++++++++++++++++++                              | 40% ~02s          
  |+++++++++++++++++++++++++                         | 50% ~02s          
  |++++++++++++++++++++++++++++++                    | 60% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=03s  
Finding all pairwise anchors

  |                                                  | 0 % ~calculating  
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 866 anchors

  |++                                                | 2 % ~01m 44s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 511 anchors

  |+++                                               | 4 % ~01m 43s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1437 anchors

  |++++                                              | 7 % ~01m 42s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 547 anchors

  |+++++                                             | 9 % ~01m 32s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1525 anchors

  |++++++                                            | 11% ~01m 31s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1309 anchors

  |+++++++                                           | 13% ~01m 26s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1008 anchors

  |++++++++                                          | 16% ~01m 25s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 657 anchors

  |+++++++++                                         | 18% ~01m 24s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 484 anchors

  |++++++++++                                        | 20% ~01m 21s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 483 anchors

  |++++++++++++                                      | 22% ~01m 18s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 825 anchors

  |+++++++++++++                                     | 24% ~01m 14s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 569 anchors

  |++++++++++++++                                    | 27% ~01m 11s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 400 anchors

  |+++++++++++++++                                   | 29% ~01m 09s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 434 anchors

  |++++++++++++++++                                  | 31% ~01m 05s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 930 anchors

  |+++++++++++++++++                                 | 33% ~01m 02s      
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 538 anchors

  |++++++++++++++++++                                | 36% ~59s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1306 anchors

  |+++++++++++++++++++                               | 38% ~58s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 654 anchors

  |++++++++++++++++++++                              | 40% ~55s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 712 anchors

  |++++++++++++++++++++++                            | 42% ~52s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 489 anchors

  |+++++++++++++++++++++++                           | 44% ~50s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 434 anchors

  |++++++++++++++++++++++++                          | 47% ~47s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 561 anchors

  |+++++++++++++++++++++++++                         | 49% ~45s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1752 anchors

  |++++++++++++++++++++++++++                        | 51% ~44s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 961 anchors

  |+++++++++++++++++++++++++++                       | 53% ~42s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1183 anchors

  |++++++++++++++++++++++++++++                      | 56% ~39s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 512 anchors

  |+++++++++++++++++++++++++++++                     | 58% ~37s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 449 anchors

  |++++++++++++++++++++++++++++++                    | 60% ~35s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 887 anchors

  |++++++++++++++++++++++++++++++++                  | 62% ~33s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 897 anchors

  |+++++++++++++++++++++++++++++++++                 | 64% ~31s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 689 anchors

  |++++++++++++++++++++++++++++++++++                | 67% ~29s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 461 anchors

  |+++++++++++++++++++++++++++++++++++               | 69% ~28s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 502 anchors

  |++++++++++++++++++++++++++++++++++++              | 71% ~25s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1401 anchors

  |+++++++++++++++++++++++++++++++++++++             | 73% ~24s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 868 anchors

  |++++++++++++++++++++++++++++++++++++++            | 76% ~21s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 470 anchors

  |+++++++++++++++++++++++++++++++++++++++           | 78% ~19s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 527 anchors

  |++++++++++++++++++++++++++++++++++++++++          | 80% ~17s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 753 anchors

  |++++++++++++++++++++++++++++++++++++++++++        | 82% ~16s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 2282 anchors

  |+++++++++++++++++++++++++++++++++++++++++++       | 84% ~14s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1102 anchors

  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~12s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1239 anchors

  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~10s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 682 anchors

  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~08s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 558 anchors

  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~06s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1248 anchors

  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~04s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 1479 anchors

  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~02s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 680 anchors

  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 27s
Error: vector memory exhausted (limit reached?)
Error during wrapup: vector memory exhausted (limit reached?)
Error: no more error handlers available (recursive errors?); invoking 'abort' restart
NPC_list <- list("HC" = int.HC,"PD" = int.PD,"PD-iso" = int.PDiso)

#listPDHC <- list("HC" = int.HC, "PD" = int.PD)
# Integrate the Seurat objects
integrated_seurat <- integrate_seurat_objects(NPC_list, dims = 1:20)
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Computing 2000 integration features
Scaling features for provided objects

  |                                                  | 0 % ~calculating  
  |+++++++++++++++++                                 | 33% ~01s          
  |++++++++++++++++++++++++++++++++++                | 67% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=03s  
Computing within dataset neighborhoods

  |                                                  | 0 % ~calculating  
  |+++++++++++++++++                                 | 33% ~05s          
  |++++++++++++++++++++++++++++++++++                | 67% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=07s  
Finding all pairwise anchors

  |                                                  | 0 % ~calculating  
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 3405 anchors

  |+++++++++++++++++                                 | 33% ~17s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 3580 anchors

  |++++++++++++++++++++++++++++++++++                | 67% ~10s          
Projecting new data onto SVD
Projecting new data onto SVD
Finding neighborhoods
Finding anchors
    Found 5952 anchors

  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=30s  
Merging dataset 2 into 3
Extracting anchors for merged samples
Finding integration vectors
Finding integration vector weights
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Integrating data
Merging dataset 1 into 3 2
Extracting anchors for merged samples
Finding integration vectors
Finding integration vector weights
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Integrating data

int.PD <- readRDS("/Users/rhalenathomas/Documents/Data/scRNAseq/ParseExample/Ex2_48well/ParseNCADDsamplesNPCintPD.RDS")
int. HC <-readRDS("/Users/rhalenathomas/Documents/Data/scRNAseq/ParseExample/Ex2_48well/ParseNCADDsamplesNPCintHC.RDS")
Error: unexpected symbol in "int. HC"
seu <- RunUMAP(seu, reduction = "pca", dims = 1:20, n.neighbors = 81)
Warning: The default method for RunUMAP has changed from calling Python UMAP via reticulate to the R-native UWOT using the cosine metric
To use Python UMAP via reticulate, set umap.method to 'umap-learn' and metric to 'correlation'
This message will be shown once per session
08:00:45 UMAP embedding parameters a = 0.9922 b = 1.112
08:00:45 Read 24642 rows and found 20 numeric columns
08:00:45 Using Annoy for neighbor search, n_neighbors = 81
08:00:45 Building Annoy index with metric = cosine, n_trees = 50
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
08:00:47 Writing NN index file to temp file /var/folders/k4/khtkczkd5tn732ftjpwgtr240000gn/T//RtmpnhJIKK/fileca8a75076310
08:00:48 Searching Annoy index using 1 thread, search_k = 8100
08:01:07 Annoy recall = 100%
08:01:07 Commencing smooth kNN distance calibration using 1 thread with target n_neighbors = 81
08:01:11 Initializing from normalized Laplacian + noise (using irlba)
08:01:13 Commencing optimization for 200 epochs, with 2439236 positive edges
Using method 'umap'
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
08:01:47 Optimization finished
seu <- FindVariableFeatures(seu)
Warning in FindVariableFeatures.Assay(object = assay.data, selection.method = selection.method,  :
  selection.method set to 'vst' but count slot is empty; will use data slot instead
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Warning in eval(predvars, data, env) : NaNs produced
Warning in hvf.info$variance.expected[not.const] <- 10^fit$fitted :
  number of items to replace is not a multiple of replacement length
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
seu <- FindNeighbors(seu, dims = 1:20, k.param = 81)
Computing nearest neighbor graph
Computing SNN
seu <- FindClusters(seu, resolution = 0.3)
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 24642
Number of edges: 3081773

Running Louvain algorithm...
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.9296
Number of communities: 12
Elapsed time: 13 seconds
DimPlot(seu)

DimPlot(seu, group.by = "Line")

DimPlot(seu, group.by = "DiseaseStatus")

saveRDS(seu,"/Users/rhalenathomas/Documents/Data/scRNAseq/ParseExample/Ex2_48well/ParseNCADDsamplesintegratedNPCs.RDS")

Annotate the NPC clusters

  1. Find markers and Check Enricher
  2. Get marker list score and

Marker list


da_neurons <- c("TH","SLC6A3","SLC18A2","SOX6","NDNF","SNCG","ALDH1A1","CALB1","TACR2","SLC17A6","SLC32A1","OTX2","GRP","LPL","CCK","VIP")
NPC_orStemLike <- c("DCX","NEUROD1","TBR1","PCNA","MKI67","SOX2","NES","PAX6","MASH1")
mature_neurons = c("RBFOX3","SYP","DLG45","VAMP1","VAMP2","TUBB3","SYT1","BSN","HOMER1","SLC17A6")
excitatory_neurons = c("GRIA2","GRIA1","GRIA4","GRIN1","GRIN2B","GRIN2A","GRIN3A","GRIN3","GRIP1","CAMK2A")
inhbitory_neurons = c("GAD1","GAD2", "GAT1","PVALB","GABR2","GABR1","GBRR1","GABRB2","GABRB1","GABRB3","GABRA6","GABRA1","GABRA4","TRAK2")
astrocytes <- c("GFAP","S100B","AQP4","APOE", "SOX9","SLC1A3")
oligodendrocytes <- c("MBP","MOG","OLIG1","OLIG2","SOX10")

radial_glia <- c("PTPRC","AIF1","ADGRE1", "VIM", "TNC","PTPRZ1","FAM107A","HOPX","LIFR",
              "ITGB5","IL6ST","SLC1A3")
epithelial <- c("HES1","HES5","SOX2","SOX10","NES","CDH1","NOTCH1")

microglia <- c("IBA1","P2RY12","P2RY13","TREM119", "GPR34","SIGLECH","TREM2",
               "CX3CR1","FCRLS","OLFML3","HEXB","TGFBR1", "SALL1","MERTK",
               "PROS1")

features_list <- c("MKI67","SOX2","POU5F1","DLX2","PAX6","SOX9","HES1","NES","RBFOX3","MAP2","NCAM1","CD24","GRIA2","GRIN2B","GABBR1","GAD1","GAD2","GABRA1","GABRB2","TH","ALDH1A1","LMX1B","NR4A2","CORIN","CALB1","KCNJ6","CXCR4","ITGA6","SLC1A3","CD44","AQP4","S100B", "PDGFRA","OLIG2","MBP","CLDN11","VIM","VCAM1")

short_list <- c("MKI67","SOX9","HES1","NES","DLX2","RBFOX3","MAP2","TH","CALB1","KCNJ6","SLC1A3","CD44","AQP4","S100B","OLIG2","MBP","VIM")


gene_lists = list("DA_neurons" = da_neurons, "NPC" = NPC_orStemLike,
                  "Neurons" = mature_neurons, "ExNeurons" = excitatory_neurons,
                  "InhNeurons" = inhbitory_neurons, "Astrocytes" = astrocytes,
                  "Oligo" = oligodendrocytes, "RadialGlia" = radial_glia,
                  "Epithelial" = epithelial, "Microglia" = microglia )
module_scores_per_gene_list <- calculate_module_scores(seu, gene_lists)
Error in base::rowMeans(x, na.rm = na.rm, dims = dims, ...) : 
  'x' must be numeric
Idents(seu) <- "integrated_snn_res.0.3"

for (i in da_neurons) {
  print(FeaturePlot(seu, features = i, min.cutoff = 'q1', max.cutoff = 'q97', label = TRUE))
}

Idents(seu) <- "integrated_snn_res.0.3"

for (i in NPC_orStemLike) {
  print(FeaturePlot(seu, features = i, min.cutoff = 'q1', max.cutoff = 'q97', label = TRUE))
}
Warning in FetchData.Seurat(object = object, vars = c(dims, "ident", features),  :
  The following requested variables were not found: MASH1
Error: None of the requested features were found: MASH1 in slot data

Idents(seu) <- "integrated_snn_res.0.3"

for (i in mature_neurons) {
  print(FeaturePlot(seu, features = i, min.cutoff = 'q1', max.cutoff = 'q97', label = TRUE))
}

DimPlot(seu)

Idents(seu) <- "integrated_snn_res.0.3"

for (i in astrocytes) {
  print(FeaturePlot(seu, features = i, min.cutoff = 'q1', max.cutoff = 'q97', label = TRUE))
}

Idents(seu) <- "integrated_snn_res.0.3"

for (i in radial_glia) {
  print(FeaturePlot(seu, features = i, min.cutoff = 'q1', max.cutoff = 'q97', label = TRUE))
}

Idents(seu) <- "integrated_snn_res.0.3"

for (i in epithelial) {
  print(FeaturePlot(seu, features = i, min.cutoff = 'q1', max.cutoff = 'q97', label = TRUE))
}

Idents(seu) <- "integrated_snn_res.0.3"

for (i in oligodendrocytes) {
  print(FeaturePlot(seu, features = i, min.cutoff = 'q1', max.cutoff = 'q97', label = TRUE))
}

Find Markers

ClusterMarkers <- FindAllMarkers(seu, only.pos = TRUE)
Calculating cluster 0

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~01m 33s      
  |++                                                | 2 % ~01m 25s      
  |++                                                | 3 % ~01m 20s      
  |+++                                               | 5 % ~01m 18s      
  |+++                                               | 6 % ~01m 16s      
  |++++                                              | 7 % ~01m 15s      
  |+++++                                             | 8 % ~01m 13s      
  |+++++                                             | 9 % ~01m 12s      
  |++++++                                            | 10% ~01m 11s      
  |++++++                                            | 12% ~01m 09s      
  |+++++++                                           | 13% ~01m 08s      
  |+++++++                                           | 14% ~01m 07s      
  |++++++++                                          | 15% ~01m 06s      
  |+++++++++                                         | 16% ~01m 05s      
  |+++++++++                                         | 17% ~01m 04s      
  |++++++++++                                        | 19% ~01m 03s      
  |++++++++++                                        | 20% ~01m 02s      
  |+++++++++++                                       | 21% ~01m 01s      
  |++++++++++++                                      | 22% ~60s          
  |++++++++++++                                      | 23% ~59s          
  |+++++++++++++                                     | 24% ~58s          
  |+++++++++++++                                     | 26% ~57s          
  |++++++++++++++                                    | 27% ~56s          
  |++++++++++++++                                    | 28% ~56s          
  |+++++++++++++++                                   | 29% ~55s          
  |++++++++++++++++                                  | 30% ~54s          
  |++++++++++++++++                                  | 31% ~53s          
  |+++++++++++++++++                                 | 33% ~52s          
  |+++++++++++++++++                                 | 34% ~51s          
  |++++++++++++++++++                                | 35% ~50s          
  |+++++++++++++++++++                               | 36% ~49s          
  |+++++++++++++++++++                               | 37% ~49s          
  |++++++++++++++++++++                              | 38% ~48s          
  |++++++++++++++++++++                              | 40% ~47s          
  |+++++++++++++++++++++                             | 41% ~46s          
  |+++++++++++++++++++++                             | 42% ~45s          
  |++++++++++++++++++++++                            | 43% ~44s          
  |+++++++++++++++++++++++                           | 44% ~43s          
  |+++++++++++++++++++++++                           | 45% ~42s          
  |++++++++++++++++++++++++                          | 47% ~41s          
  |++++++++++++++++++++++++                          | 48% ~40s          
  |+++++++++++++++++++++++++                         | 49% ~39s          
  |+++++++++++++++++++++++++                         | 50% ~38s          
  |++++++++++++++++++++++++++                        | 51% ~37s          
  |+++++++++++++++++++++++++++                       | 52% ~37s          
  |+++++++++++++++++++++++++++                       | 53% ~36s          
  |++++++++++++++++++++++++++++                      | 55% ~35s          
  |++++++++++++++++++++++++++++                      | 56% ~34s          
  |+++++++++++++++++++++++++++++                     | 57% ~33s          
  |++++++++++++++++++++++++++++++                    | 58% ~32s          
  |++++++++++++++++++++++++++++++                    | 59% ~31s          
  |+++++++++++++++++++++++++++++++                   | 60% ~30s          
  |+++++++++++++++++++++++++++++++                   | 62% ~29s          
  |++++++++++++++++++++++++++++++++                  | 63% ~28s          
  |++++++++++++++++++++++++++++++++                  | 64% ~28s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~27s          
  |++++++++++++++++++++++++++++++++++                | 66% ~26s          
  |++++++++++++++++++++++++++++++++++                | 67% ~25s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~24s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~23s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~22s          
  |+++++++++++++++++++++++++++++++++++++             | 72% ~21s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~20s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~19s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~19s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~18s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~17s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~16s          
  |+++++++++++++++++++++++++++++++++++++++++         | 80% ~15s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~14s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~13s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~12s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~11s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 86% ~11s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~10s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 88% ~09s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~08s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~07s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 92% ~06s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~05s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 94% ~04s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~03s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 15s
Calculating cluster 1

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~01m 42s      
  |++                                                | 2 % ~01m 34s      
  |++                                                | 3 % ~01m 32s      
  |+++                                               | 4 % ~01m 30s      
  |+++                                               | 5 % ~01m 30s      
  |++++                                              | 6 % ~01m 27s      
  |++++                                              | 7 % ~01m 26s      
  |+++++                                             | 9 % ~01m 25s      
  |+++++                                             | 10% ~01m 24s      
  |++++++                                            | 11% ~01m 23s      
  |++++++                                            | 12% ~01m 22s      
  |+++++++                                           | 13% ~01m 21s      
  |+++++++                                           | 14% ~01m 20s      
  |++++++++                                          | 15% ~01m 19s      
  |++++++++                                          | 16% ~01m 18s      
  |+++++++++                                         | 17% ~01m 17s      
  |++++++++++                                        | 18% ~01m 16s      
  |++++++++++                                        | 19% ~01m 15s      
  |+++++++++++                                       | 20% ~01m 14s      
  |+++++++++++                                       | 21% ~01m 13s      
  |++++++++++++                                      | 22% ~01m 12s      
  |++++++++++++                                      | 23% ~01m 11s      
  |+++++++++++++                                     | 24% ~01m 10s      
  |+++++++++++++                                     | 26% ~01m 09s      
  |++++++++++++++                                    | 27% ~01m 08s      
  |++++++++++++++                                    | 28% ~01m 07s      
  |+++++++++++++++                                   | 29% ~01m 06s      
  |+++++++++++++++                                   | 30% ~01m 05s      
  |++++++++++++++++                                  | 31% ~01m 04s      
  |++++++++++++++++                                  | 32% ~01m 03s      
  |+++++++++++++++++                                 | 33% ~01m 02s      
  |++++++++++++++++++                                | 34% ~01m 01s      
  |++++++++++++++++++                                | 35% ~60s          
  |+++++++++++++++++++                               | 36% ~59s          
  |+++++++++++++++++++                               | 37% ~58s          
  |++++++++++++++++++++                              | 38% ~57s          
  |++++++++++++++++++++                              | 39% ~56s          
  |+++++++++++++++++++++                             | 40% ~55s          
  |+++++++++++++++++++++                             | 41% ~54s          
  |++++++++++++++++++++++                            | 43% ~53s          
  |++++++++++++++++++++++                            | 44% ~52s          
  |+++++++++++++++++++++++                           | 45% ~51s          
  |+++++++++++++++++++++++                           | 46% ~50s          
  |++++++++++++++++++++++++                          | 47% ~49s          
  |++++++++++++++++++++++++                          | 48% ~48s          
  |+++++++++++++++++++++++++                         | 49% ~48s          
  |+++++++++++++++++++++++++                         | 50% ~47s          
  |++++++++++++++++++++++++++                        | 51% ~46s          
  |+++++++++++++++++++++++++++                       | 52% ~45s          
  |+++++++++++++++++++++++++++                       | 53% ~44s          
  |++++++++++++++++++++++++++++                      | 54% ~43s          
  |++++++++++++++++++++++++++++                      | 55% ~42s          
  |+++++++++++++++++++++++++++++                     | 56% ~41s          
  |+++++++++++++++++++++++++++++                     | 57% ~40s          
  |++++++++++++++++++++++++++++++                    | 59% ~39s          
  |++++++++++++++++++++++++++++++                    | 60% ~38s          
  |+++++++++++++++++++++++++++++++                   | 61% ~37s          
  |+++++++++++++++++++++++++++++++                   | 62% ~36s          
  |++++++++++++++++++++++++++++++++                  | 63% ~34s          
  |++++++++++++++++++++++++++++++++                  | 64% ~33s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~32s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~31s          
  |++++++++++++++++++++++++++++++++++                | 67% ~30s          
  |+++++++++++++++++++++++++++++++++++               | 68% ~29s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~28s          
  |++++++++++++++++++++++++++++++++++++              | 70% ~28s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~27s          
  |+++++++++++++++++++++++++++++++++++++             | 72% ~26s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~25s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~24s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~23s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~22s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~21s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~20s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~19s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~18s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~17s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~16s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 84% ~15s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~14s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 86% ~13s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~12s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 88% ~11s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~10s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 90% ~09s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~08s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~07s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~06s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~05s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~03s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 31s
Calculating cluster 2

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~01m 59s      
  |++                                                | 2 % ~01m 58s      
  |++                                                | 3 % ~01m 58s      
  |+++                                               | 4 % ~01m 57s      
  |+++                                               | 5 % ~01m 55s      
  |++++                                              | 6 % ~01m 54s      
  |++++                                              | 8 % ~01m 52s      
  |+++++                                             | 9 % ~01m 50s      
  |+++++                                             | 10% ~01m 49s      
  |++++++                                            | 11% ~01m 48s      
  |++++++                                            | 12% ~01m 47s      
  |+++++++                                           | 13% ~01m 45s      
  |+++++++                                           | 14% ~01m 43s      
  |++++++++                                          | 15% ~01m 42s      
  |+++++++++                                         | 16% ~01m 41s      
  |+++++++++                                         | 17% ~01m 40s      
  |++++++++++                                        | 18% ~01m 39s      
  |++++++++++                                        | 19% ~01m 38s      
  |+++++++++++                                       | 20% ~01m 36s      
  |+++++++++++                                       | 22% ~01m 35s      
  |++++++++++++                                      | 23% ~01m 34s      
  |++++++++++++                                      | 24% ~01m 33s      
  |+++++++++++++                                     | 25% ~01m 31s      
  |+++++++++++++                                     | 26% ~01m 30s      
  |++++++++++++++                                    | 27% ~01m 29s      
  |++++++++++++++                                    | 28% ~01m 27s      
  |+++++++++++++++                                   | 29% ~01m 26s      
  |++++++++++++++++                                  | 30% ~01m 25s      
  |++++++++++++++++                                  | 31% ~01m 24s      
  |+++++++++++++++++                                 | 32% ~01m 22s      
  |+++++++++++++++++                                 | 33% ~01m 21s      
  |++++++++++++++++++                                | 34% ~01m 19s      
  |++++++++++++++++++                                | 35% ~01m 18s      
  |+++++++++++++++++++                               | 37% ~01m 17s      
  |+++++++++++++++++++                               | 38% ~01m 16s      
  |++++++++++++++++++++                              | 39% ~01m 14s      
  |++++++++++++++++++++                              | 40% ~01m 13s      
  |+++++++++++++++++++++                             | 41% ~01m 11s      
  |+++++++++++++++++++++                             | 42% ~01m 10s      
  |++++++++++++++++++++++                            | 43% ~01m 09s      
  |+++++++++++++++++++++++                           | 44% ~01m 08s      
  |+++++++++++++++++++++++                           | 45% ~01m 06s      
  |++++++++++++++++++++++++                          | 46% ~01m 05s      
  |++++++++++++++++++++++++                          | 47% ~01m 04s      
  |+++++++++++++++++++++++++                         | 48% ~01m 03s      
  |+++++++++++++++++++++++++                         | 49% ~01m 02s      
  |++++++++++++++++++++++++++                        | 51% ~01m 00s      
  |++++++++++++++++++++++++++                        | 52% ~59s          
  |+++++++++++++++++++++++++++                       | 53% ~58s          
  |+++++++++++++++++++++++++++                       | 54% ~56s          
  |++++++++++++++++++++++++++++                      | 55% ~55s          
  |++++++++++++++++++++++++++++                      | 56% ~54s          
  |+++++++++++++++++++++++++++++                     | 57% ~52s          
  |++++++++++++++++++++++++++++++                    | 58% ~51s          
  |++++++++++++++++++++++++++++++                    | 59% ~50s          
  |+++++++++++++++++++++++++++++++                   | 60% ~48s          
  |+++++++++++++++++++++++++++++++                   | 61% ~47s          
  |++++++++++++++++++++++++++++++++                  | 62% ~46s          
  |++++++++++++++++++++++++++++++++                  | 63% ~44s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~43s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~42s          
  |++++++++++++++++++++++++++++++++++                | 67% ~40s          
  |++++++++++++++++++++++++++++++++++                | 68% ~39s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~38s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~36s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~35s          
  |+++++++++++++++++++++++++++++++++++++             | 72% ~34s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~33s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~31s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~30s          
  |+++++++++++++++++++++++++++++++++++++++           | 76% ~29s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~27s          
  |++++++++++++++++++++++++++++++++++++++++          | 78% ~26s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~25s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~23s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~22s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~21s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~20s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~18s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 86% ~17s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~16s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 88% ~14s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~13s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 90% ~12s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~10s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 92% ~09s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~08s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~07s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~05s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~03s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 59s
Calculating cluster 3

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~01m 29s      
  |++                                                | 2 % ~01m 32s      
  |++                                                | 3 % ~01m 34s      
  |+++                                               | 4 % ~01m 32s      
  |+++                                               | 5 % ~01m 33s      
  |++++                                              | 6 % ~01m 32s      
  |++++                                              | 7 % ~01m 31s      
  |+++++                                             | 8 % ~01m 30s      
  |+++++                                             | 9 % ~01m 28s      
  |++++++                                            | 11% ~01m 28s      
  |++++++                                            | 12% ~01m 27s      
  |+++++++                                           | 13% ~01m 25s      
  |+++++++                                           | 14% ~01m 24s      
  |++++++++                                          | 15% ~01m 23s      
  |++++++++                                          | 16% ~01m 22s      
  |+++++++++                                         | 17% ~01m 21s      
  |+++++++++                                         | 18% ~01m 20s      
  |++++++++++                                        | 19% ~01m 19s      
  |++++++++++                                        | 20% ~01m 17s      
  |+++++++++++                                       | 21% ~01m 16s      
  |++++++++++++                                      | 22% ~01m 15s      
  |++++++++++++                                      | 23% ~01m 14s      
  |+++++++++++++                                     | 24% ~01m 13s      
  |+++++++++++++                                     | 25% ~01m 11s      
  |++++++++++++++                                    | 26% ~01m 10s      
  |++++++++++++++                                    | 27% ~01m 10s      
  |+++++++++++++++                                   | 28% ~01m 08s      
  |+++++++++++++++                                   | 29% ~01m 07s      
  |++++++++++++++++                                  | 31% ~01m 06s      
  |++++++++++++++++                                  | 32% ~01m 05s      
  |+++++++++++++++++                                 | 33% ~01m 04s      
  |+++++++++++++++++                                 | 34% ~01m 03s      
  |++++++++++++++++++                                | 35% ~01m 02s      
  |++++++++++++++++++                                | 36% ~01m 01s      
  |+++++++++++++++++++                               | 37% ~60s          
  |+++++++++++++++++++                               | 38% ~59s          
  |++++++++++++++++++++                              | 39% ~58s          
  |++++++++++++++++++++                              | 40% ~57s          
  |+++++++++++++++++++++                             | 41% ~57s          
  |++++++++++++++++++++++                            | 42% ~56s          
  |++++++++++++++++++++++                            | 43% ~55s          
  |+++++++++++++++++++++++                           | 44% ~54s          
  |+++++++++++++++++++++++                           | 45% ~53s          
  |++++++++++++++++++++++++                          | 46% ~52s          
  |++++++++++++++++++++++++                          | 47% ~51s          
  |+++++++++++++++++++++++++                         | 48% ~49s          
  |+++++++++++++++++++++++++                         | 49% ~48s          
  |++++++++++++++++++++++++++                        | 51% ~47s          
  |++++++++++++++++++++++++++                        | 52% ~47s          
  |+++++++++++++++++++++++++++                       | 53% ~46s          
  |+++++++++++++++++++++++++++                       | 54% ~45s          
  |++++++++++++++++++++++++++++                      | 55% ~44s          
  |++++++++++++++++++++++++++++                      | 56% ~43s          
  |+++++++++++++++++++++++++++++                     | 57% ~42s          
  |+++++++++++++++++++++++++++++                     | 58% ~41s          
  |++++++++++++++++++++++++++++++                    | 59% ~40s          
  |++++++++++++++++++++++++++++++                    | 60% ~02m 24s      
  |+++++++++++++++++++++++++++++++                   | 61% ~02m 18s      
  |++++++++++++++++++++++++++++++++                  | 62% ~02m 13s      
  |++++++++++++++++++++++++++++++++                  | 63% ~02m 07s      
  |+++++++++++++++++++++++++++++++++                 | 64% ~02m 02s      
  |+++++++++++++++++++++++++++++++++                 | 65% ~01m 57s      
  |++++++++++++++++++++++++++++++++++                | 66% ~01m 52s      
  |++++++++++++++++++++++++++++++++++                | 67% ~01m 48s      
  |+++++++++++++++++++++++++++++++++++               | 68% ~01m 43s      
  |+++++++++++++++++++++++++++++++++++               | 69% ~01m 38s      
  |++++++++++++++++++++++++++++++++++++              | 71% ~01m 34s      
  |++++++++++++++++++++++++++++++++++++              | 72% ~01m 30s      
  |+++++++++++++++++++++++++++++++++++++             | 73% ~01m 26s      
  |+++++++++++++++++++++++++++++++++++++             | 74% ~01m 21s      
  |++++++++++++++++++++++++++++++++++++++            | 75% ~01m 17s      
  |++++++++++++++++++++++++++++++++++++++            | 76% ~01m 13s      
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~01m 10s      
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~01m 06s      
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~01m 02s      
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~58s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~55s          
  |++++++++++++++++++++++++++++++++++++++++++        | 82% ~51s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~48s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 84% ~45s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~41s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 86% ~38s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~35s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 88% ~32s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~29s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~26s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 92% ~23s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~20s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~17s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~14s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~11s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~08s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~05s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~03s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=04m 12s
Calculating cluster 4

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~01m 04s      
  |++                                                | 2 % ~01m 07s      
  |++                                                | 3 % ~01m 08s      
  |+++                                               | 5 % ~01m 08s      
  |+++                                               | 6 % ~01m 07s      
  |++++                                              | 7 % ~01m 06s      
  |+++++                                             | 8 % ~01m 05s      
  |+++++                                             | 9 % ~01m 04s      
  |++++++                                            | 10% ~01m 03s      
  |++++++                                            | 11% ~01m 02s      
  |+++++++                                           | 13% ~01m 01s      
  |+++++++                                           | 14% ~60s          
  |++++++++                                          | 15% ~59s          
  |+++++++++                                         | 16% ~21m 41s      
  |+++++++++                                         | 17% ~20m 02s      
  |++++++++++                                        | 18% ~18m 35s      
  |++++++++++                                        | 20% ~17m 18s      
  |+++++++++++                                       | 21% ~16m 09s      
  |+++++++++++                                       | 22% ~15m 08s      
  |++++++++++++                                      | 23% ~14m 13s      
  |+++++++++++++                                     | 24% ~13m 22s      
  |+++++++++++++                                     | 25% ~12m 37s      
  |++++++++++++++                                    | 26% ~11m 55s      
  |++++++++++++++                                    | 28% ~11m 16s      
  |+++++++++++++++                                   | 29% ~10m 41s      
  |+++++++++++++++                                   | 30% ~10m 09s      
  |++++++++++++++++                                  | 31% ~09m 38s      
  |+++++++++++++++++                                 | 32% ~09m 10s      
  |+++++++++++++++++                                 | 33% ~08m 44s      
  |++++++++++++++++++                                | 34% ~08m 19s      
  |++++++++++++++++++                                | 36% ~07m 56s      
  |+++++++++++++++++++                               | 37% ~07m 34s      
  |+++++++++++++++++++                               | 38% ~07m 14s      
  |++++++++++++++++++++                              | 39% ~06m 55s      
  |+++++++++++++++++++++                             | 40% ~06m 36s      
  |+++++++++++++++++++++                             | 41% ~06m 19s      
  |++++++++++++++++++++++                            | 43% ~06m 03s      
  |++++++++++++++++++++++                            | 44% ~05m 47s      
  |+++++++++++++++++++++++                           | 45% ~05m 32s      
  |+++++++++++++++++++++++                           | 46% ~05m 18s      
  |++++++++++++++++++++++++                          | 47% ~05m 05s      
  |+++++++++++++++++++++++++                         | 48% ~04m 52s      
  |+++++++++++++++++++++++++                         | 49% ~04m 40s      
  |++++++++++++++++++++++++++                        | 51% ~04m 28s      
  |++++++++++++++++++++++++++                        | 52% ~04m 17s      
  |+++++++++++++++++++++++++++                       | 53% ~04m 06s      
  |++++++++++++++++++++++++++++                      | 54% ~03m 56s      
  |++++++++++++++++++++++++++++                      | 55% ~03m 46s      
  |+++++++++++++++++++++++++++++                     | 56% ~03m 36s      
  |+++++++++++++++++++++++++++++                     | 57% ~03m 27s      
  |++++++++++++++++++++++++++++++                    | 59% ~03m 18s      
  |++++++++++++++++++++++++++++++                    | 60% ~03m 09s      
  |+++++++++++++++++++++++++++++++                   | 61% ~03m 01s      
  |++++++++++++++++++++++++++++++++                  | 62% ~02m 53s      
  |++++++++++++++++++++++++++++++++                  | 63% ~02m 45s      
  |+++++++++++++++++++++++++++++++++                 | 64% ~02m 37s      
  |+++++++++++++++++++++++++++++++++                 | 66% ~02m 30s      
  |++++++++++++++++++++++++++++++++++                | 67% ~02m 23s      
  |++++++++++++++++++++++++++++++++++                | 68% ~02m 16s      
  |+++++++++++++++++++++++++++++++++++               | 69% ~02m 09s      
  |++++++++++++++++++++++++++++++++++++              | 70% ~02m 03s      
  |++++++++++++++++++++++++++++++++++++              | 71% ~01m 57s      
  |+++++++++++++++++++++++++++++++++++++             | 72% ~01m 50s      
  |+++++++++++++++++++++++++++++++++++++             | 74% ~01m 44s      
  |++++++++++++++++++++++++++++++++++++++            | 75% ~01m 39s      
  |++++++++++++++++++++++++++++++++++++++            | 76% ~01m 33s      
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~01m 27s      
  |++++++++++++++++++++++++++++++++++++++++          | 78% ~01m 22s      
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~01m 17s      
  |+++++++++++++++++++++++++++++++++++++++++         | 80% ~01m 12s      
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~01m 07s      
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~01m 02s      
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~57s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~52s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 86% ~48s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~43s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~39s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~35s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~31s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 92% ~27s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~22s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 94% ~19s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~15s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~11s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~07s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~04s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=05m 08s
Calculating cluster 5

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~02m 06s      
  |++                                                | 2 % ~01m 59s      
  |++                                                | 3 % ~01m 56s      
  |+++                                               | 4 % ~01m 55s      
  |+++                                               | 5 % ~01m 53s      
  |++++                                              | 6 % ~01m 52s      
  |++++                                              | 7 % ~01m 51s      
  |+++++                                             | 9 % ~01m 50s      
  |+++++                                             | 10% ~01m 49s      
  |++++++                                            | 11% ~01m 47s      
  |++++++                                            | 12% ~01m 46s      
  |+++++++                                           | 13% ~01m 45s      
  |+++++++                                           | 14% ~01m 43s      
  |++++++++                                          | 15% ~01m 42s      
  |++++++++                                          | 16% ~01m 40s      
  |+++++++++                                         | 17% ~01m 39s      
  |++++++++++                                        | 18% ~01m 37s      
  |++++++++++                                        | 19% ~01m 35s      
  |+++++++++++                                       | 20% ~01m 34s      
  |+++++++++++                                       | 21% ~01m 33s      
  |++++++++++++                                      | 22% ~01m 32s      
  |++++++++++++                                      | 23% ~01m 31s      
  |+++++++++++++                                     | 24% ~01m 29s      
  |+++++++++++++                                     | 26% ~01m 28s      
  |++++++++++++++                                    | 27% ~01m 27s      
  |++++++++++++++                                    | 28% ~01m 25s      
  |+++++++++++++++                                   | 29% ~01m 24s      
  |+++++++++++++++                                   | 30% ~01m 23s      
  |++++++++++++++++                                  | 31% ~01m 21s      
  |++++++++++++++++                                  | 32% ~01m 20s      
  |+++++++++++++++++                                 | 33% ~01m 19s      
  |++++++++++++++++++                                | 34% ~01m 17s      
  |++++++++++++++++++                                | 35% ~01m 16s      
  |+++++++++++++++++++                               | 36% ~01m 15s      
  |+++++++++++++++++++                               | 37% ~01m 14s      
  |++++++++++++++++++++                              | 38% ~01m 12s      
  |++++++++++++++++++++                              | 39% ~01m 11s      
  |+++++++++++++++++++++                             | 40% ~01m 10s      
  |+++++++++++++++++++++                             | 41% ~01m 08s      
  |++++++++++++++++++++++                            | 43% ~01m 07s      
  |++++++++++++++++++++++                            | 44% ~01m 06s      
  |+++++++++++++++++++++++                           | 45% ~01m 05s      
  |+++++++++++++++++++++++                           | 46% ~01m 04s      
  |++++++++++++++++++++++++                          | 47% ~01m 03s      
  |++++++++++++++++++++++++                          | 48% ~01m 01s      
  |+++++++++++++++++++++++++                         | 49% ~60s          
  |+++++++++++++++++++++++++                         | 50% ~59s          
  |++++++++++++++++++++++++++                        | 51% ~57s          
  |+++++++++++++++++++++++++++                       | 52% ~56s          
  |+++++++++++++++++++++++++++                       | 53% ~55s          
  |++++++++++++++++++++++++++++                      | 54% ~54s          
  |++++++++++++++++++++++++++++                      | 55% ~52s          
  |+++++++++++++++++++++++++++++                     | 56% ~51s          
  |+++++++++++++++++++++++++++++                     | 57% ~50s          
  |++++++++++++++++++++++++++++++                    | 59% ~48s          
  |++++++++++++++++++++++++++++++                    | 60% ~47s          
  |+++++++++++++++++++++++++++++++                   | 61% ~46s          
  |+++++++++++++++++++++++++++++++                   | 62% ~45s          
  |++++++++++++++++++++++++++++++++                  | 63% ~43s          
  |++++++++++++++++++++++++++++++++                  | 64% ~42s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~41s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~40s          
  |++++++++++++++++++++++++++++++++++                | 67% ~38s          
  |+++++++++++++++++++++++++++++++++++               | 68% ~37s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~36s          
  |++++++++++++++++++++++++++++++++++++              | 70% ~35s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~33s          
  |+++++++++++++++++++++++++++++++++++++             | 72% ~32s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~31s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~30s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~28s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~27s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~26s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~25s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~23s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~22s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~21s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~20s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 84% ~18s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~17s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 86% ~16s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~15s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 88% ~14s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~12s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 90% ~11s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~10s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~09s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~07s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~06s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~05s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 54s
Calculating cluster 6

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~01m 33s      
  |++                                                | 2 % ~01m 27s      
  |++                                                | 3 % ~01m 26s      
  |+++                                               | 4 % ~01m 23s      
  |+++                                               | 6 % ~01m 21s      
  |++++                                              | 7 % ~01m 21s      
  |++++                                              | 8 % ~01m 20s      
  |+++++                                             | 9 % ~01m 20s      
  |++++++                                            | 10% ~01m 18s      
  |++++++                                            | 11% ~01m 17s      
  |+++++++                                           | 12% ~01m 16s      
  |+++++++                                           | 13% ~01m 15s      
  |++++++++                                          | 15% ~01m 14s      
  |++++++++                                          | 16% ~01m 12s      
  |+++++++++                                         | 17% ~01m 11s      
  |+++++++++                                         | 18% ~01m 10s      
  |++++++++++                                        | 19% ~01m 09s      
  |+++++++++++                                       | 20% ~01m 08s      
  |+++++++++++                                       | 21% ~01m 07s      
  |++++++++++++                                      | 22% ~01m 06s      
  |++++++++++++                                      | 24% ~01m 05s      
  |+++++++++++++                                     | 25% ~01m 04s      
  |+++++++++++++                                     | 26% ~01m 03s      
  |++++++++++++++                                    | 27% ~01m 02s      
  |+++++++++++++++                                   | 28% ~01m 01s      
  |+++++++++++++++                                   | 29% ~01m 00s      
  |++++++++++++++++                                  | 30% ~01m 00s      
  |++++++++++++++++                                  | 31% ~59s          
  |+++++++++++++++++                                 | 33% ~58s          
  |+++++++++++++++++                                 | 34% ~57s          
  |++++++++++++++++++                                | 35% ~56s          
  |++++++++++++++++++                                | 36% ~55s          
  |+++++++++++++++++++                               | 37% ~54s          
  |++++++++++++++++++++                              | 38% ~53s          
  |++++++++++++++++++++                              | 39% ~52s          
  |+++++++++++++++++++++                             | 40% ~51s          
  |+++++++++++++++++++++                             | 42% ~50s          
  |++++++++++++++++++++++                            | 43% ~49s          
  |++++++++++++++++++++++                            | 44% ~48s          
  |+++++++++++++++++++++++                           | 45% ~47s          
  |++++++++++++++++++++++++                          | 46% ~46s          
  |++++++++++++++++++++++++                          | 47% ~45s          
  |+++++++++++++++++++++++++                         | 48% ~44s          
  |+++++++++++++++++++++++++                         | 49% ~43s          
  |++++++++++++++++++++++++++                        | 51% ~42s          
  |++++++++++++++++++++++++++                        | 52% ~41s          
  |+++++++++++++++++++++++++++                       | 53% ~40s          
  |+++++++++++++++++++++++++++                       | 54% ~39s          
  |++++++++++++++++++++++++++++                      | 55% ~39s          
  |+++++++++++++++++++++++++++++                     | 56% ~38s          
  |+++++++++++++++++++++++++++++                     | 57% ~37s          
  |++++++++++++++++++++++++++++++                    | 58% ~36s          
  |++++++++++++++++++++++++++++++                    | 60% ~35s          
  |+++++++++++++++++++++++++++++++                   | 61% ~34s          
  |+++++++++++++++++++++++++++++++                   | 62% ~33s          
  |++++++++++++++++++++++++++++++++                  | 63% ~32s          
  |+++++++++++++++++++++++++++++++++                 | 64% ~31s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~30s          
  |++++++++++++++++++++++++++++++++++                | 66% ~29s          
  |++++++++++++++++++++++++++++++++++                | 67% ~28s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~27s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~26s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~25s          
  |++++++++++++++++++++++++++++++++++++              | 72% ~24s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~23s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~22s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~21s          
  |+++++++++++++++++++++++++++++++++++++++           | 76% ~20s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~19s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~18s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~17s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~16s          
  |++++++++++++++++++++++++++++++++++++++++++        | 82% ~15s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~14s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 84% ~13s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~12s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~11s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 88% ~10s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~09s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~09s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~08s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 92% ~07s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~06s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 94% ~05s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~03s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 23s
Calculating cluster 7

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~01m 12s      
  |++                                                | 2 % ~01m 11s      
  |++                                                | 3 % ~01m 12s      
  |+++                                               | 4 % ~01m 10s      
  |+++                                               | 6 % ~01m 09s      
  |++++                                              | 7 % ~01m 09s      
  |++++                                              | 8 % ~01m 09s      
  |+++++                                             | 9 % ~01m 08s      
  |++++++                                            | 10% ~01m 06s      
  |++++++                                            | 11% ~01m 06s      
  |+++++++                                           | 12% ~01m 05s      
  |+++++++                                           | 13% ~01m 04s      
  |++++++++                                          | 15% ~01m 04s      
  |++++++++                                          | 16% ~01m 03s      
  |+++++++++                                         | 17% ~01m 02s      
  |+++++++++                                         | 18% ~01m 01s      
  |++++++++++                                        | 19% ~01m 00s      
  |+++++++++++                                       | 20% ~59s          
  |+++++++++++                                       | 21% ~59s          
  |++++++++++++                                      | 22% ~58s          
  |++++++++++++                                      | 24% ~59s          
  |+++++++++++++                                     | 25% ~58s          
  |+++++++++++++                                     | 26% ~58s          
  |++++++++++++++                                    | 27% ~58s          
  |+++++++++++++++                                   | 28% ~57s          
  |+++++++++++++++                                   | 29% ~56s          
  |++++++++++++++++                                  | 30% ~55s          
  |++++++++++++++++                                  | 31% ~01m 01s      
  |+++++++++++++++++                                 | 33% ~59s          
  |+++++++++++++++++                                 | 34% ~58s          
  |++++++++++++++++++                                | 35% ~57s          
  |++++++++++++++++++                                | 36% ~56s          
  |+++++++++++++++++++                               | 37% ~54s          
  |++++++++++++++++++++                              | 38% ~53s          
  |++++++++++++++++++++                              | 39% ~52s          
  |+++++++++++++++++++++                             | 40% ~51s          
  |+++++++++++++++++++++                             | 42% ~50s          
  |++++++++++++++++++++++                            | 43% ~49s          
  |++++++++++++++++++++++                            | 44% ~47s          
  |+++++++++++++++++++++++                           | 45% ~46s          
  |++++++++++++++++++++++++                          | 46% ~45s          
  |++++++++++++++++++++++++                          | 47% ~44s          
  |+++++++++++++++++++++++++                         | 48% ~43s          
  |+++++++++++++++++++++++++                         | 49% ~42s          
  |++++++++++++++++++++++++++                        | 51% ~41s          
  |++++++++++++++++++++++++++                        | 52% ~40s          
  |+++++++++++++++++++++++++++                       | 53% ~39s          
  |+++++++++++++++++++++++++++                       | 54% ~38s          
  |++++++++++++++++++++++++++++                      | 55% ~37s          
  |+++++++++++++++++++++++++++++                     | 56% ~36s          
  |+++++++++++++++++++++++++++++                     | 57% ~35s          
  |++++++++++++++++++++++++++++++                    | 58% ~34s          
  |++++++++++++++++++++++++++++++                    | 60% ~33s          
  |+++++++++++++++++++++++++++++++                   | 61% ~32s          
  |+++++++++++++++++++++++++++++++                   | 62% ~31s          
  |++++++++++++++++++++++++++++++++                  | 63% ~30s          
  |+++++++++++++++++++++++++++++++++                 | 64% ~29s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~28s          
  |++++++++++++++++++++++++++++++++++                | 66% ~27s          
  |++++++++++++++++++++++++++++++++++                | 67% ~26s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~25s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~24s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~24s          
  |++++++++++++++++++++++++++++++++++++              | 72% ~23s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~22s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~21s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~20s          
  |+++++++++++++++++++++++++++++++++++++++           | 76% ~19s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~18s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~17s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~16s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~15s          
  |++++++++++++++++++++++++++++++++++++++++++        | 82% ~14s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~13s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 84% ~13s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~12s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~11s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 88% ~10s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~09s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~08s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~07s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 92% ~06s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~05s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 94% ~44s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~34s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~26s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~17s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~08s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=12m 16s
Calculating cluster 8

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~01m 55s      
  |++                                                | 2 % ~01m 57s      
  |++                                                | 3 % ~01m 52s      
  |+++                                               | 4 % ~01m 52s      
  |+++                                               | 5 % ~01m 50s      
  |++++                                              | 7 % ~01m 51s      
  |++++                                              | 8 % ~01m 49s      
  |+++++                                             | 9 % ~01m 48s      
  |+++++                                             | 10% ~01m 46s      
  |++++++                                            | 11% ~01m 45s      
  |+++++++                                           | 12% ~01m 44s      
  |+++++++                                           | 13% ~01m 42s      
  |++++++++                                          | 14% ~01m 41s      
  |++++++++                                          | 15% ~01m 40s      
  |+++++++++                                         | 16% ~01m 38s      
  |+++++++++                                         | 18% ~01m 39s      
  |++++++++++                                        | 19% ~01m 38s      
  |++++++++++                                        | 20% ~01m 36s      
  |+++++++++++                                       | 21% ~01m 35s      
  |+++++++++++                                       | 22% ~01m 33s      
  |++++++++++++                                      | 23% ~01m 32s      
  |+++++++++++++                                     | 24% ~01m 30s      
  |+++++++++++++                                     | 25% ~01m 29s      
  |++++++++++++++                                    | 26% ~01m 27s      
  |++++++++++++++                                    | 27% ~01m 26s      
  |+++++++++++++++                                   | 29% ~01m 24s      
  |+++++++++++++++                                   | 30% ~01m 23s      
  |++++++++++++++++                                  | 31% ~01m 21s      
  |++++++++++++++++                                  | 32% ~01m 20s      
  |+++++++++++++++++                                 | 33% ~01m 19s      
  |++++++++++++++++++                                | 34% ~01m 17s      
  |++++++++++++++++++                                | 35% ~01m 16s      
  |+++++++++++++++++++                               | 36% ~01m 15s      
  |+++++++++++++++++++                               | 37% ~01m 13s      
  |++++++++++++++++++++                              | 38% ~01m 12s      
  |++++++++++++++++++++                              | 40% ~01m 10s      
  |+++++++++++++++++++++                             | 41% ~01m 09s      
  |+++++++++++++++++++++                             | 42% ~01m 08s      
  |++++++++++++++++++++++                            | 43% ~01m 07s      
  |++++++++++++++++++++++                            | 44% ~01m 05s      
  |+++++++++++++++++++++++                           | 45% ~01m 04s      
  |++++++++++++++++++++++++                          | 46% ~01m 03s      
  |++++++++++++++++++++++++                          | 47% ~01m 02s      
  |+++++++++++++++++++++++++                         | 48% ~01m 00s      
  |+++++++++++++++++++++++++                         | 49% ~59s          
  |++++++++++++++++++++++++++                        | 51% ~58s          
  |++++++++++++++++++++++++++                        | 52% ~57s          
  |+++++++++++++++++++++++++++                       | 53% ~55s          
  |+++++++++++++++++++++++++++                       | 54% ~54s          
  |++++++++++++++++++++++++++++                      | 55% ~53s          
  |+++++++++++++++++++++++++++++                     | 56% ~51s          
  |+++++++++++++++++++++++++++++                     | 57% ~50s          
  |++++++++++++++++++++++++++++++                    | 58% ~49s          
  |++++++++++++++++++++++++++++++                    | 59% ~48s          
  |+++++++++++++++++++++++++++++++                   | 60% ~46s          
  |+++++++++++++++++++++++++++++++                   | 62% ~45s          
  |++++++++++++++++++++++++++++++++                  | 63% ~44s          
  |++++++++++++++++++++++++++++++++                  | 64% ~42s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~41s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~40s          
  |++++++++++++++++++++++++++++++++++                | 67% ~38s          
  |+++++++++++++++++++++++++++++++++++               | 68% ~37s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~36s          
  |++++++++++++++++++++++++++++++++++++              | 70% ~35s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~33s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~32s          
  |+++++++++++++++++++++++++++++++++++++             | 74% ~31s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~30s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~29s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~27s          
  |++++++++++++++++++++++++++++++++++++++++          | 78% ~26s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~25s          
  |+++++++++++++++++++++++++++++++++++++++++         | 80% ~24s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~22s          
  |++++++++++++++++++++++++++++++++++++++++++        | 82% ~21s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~20s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~19s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 86% ~18s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~17s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 88% ~15s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~14s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 90% ~13s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~11s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 92% ~10s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~08s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~07s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~06s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~03s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02m 09s
Calculating cluster 9

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~01m 58s      
  |++                                                | 2 % ~01m 60s      
  |++                                                | 3 % ~01m 58s      
  |+++                                               | 4 % ~01m 58s      
  |+++                                               | 5 % ~01m 58s      
  |++++                                              | 6 % ~01m 58s      
  |++++                                              | 8 % ~01m 57s      
  |+++++                                             | 9 % ~01m 56s      
  |+++++                                             | 10% ~01m 55s      
  |++++++                                            | 11% ~01m 54s      
  |++++++                                            | 12% ~01m 52s      
  |+++++++                                           | 13% ~01m 51s      
  |+++++++                                           | 14% ~01m 49s      
  |++++++++                                          | 15% ~01m 48s      
  |+++++++++                                         | 16% ~01m 47s      
  |+++++++++                                         | 17% ~01m 46s      
  |++++++++++                                        | 18% ~01m 45s      
  |++++++++++                                        | 19% ~01m 43s      
  |+++++++++++                                       | 20% ~01m 42s      
  |+++++++++++                                       | 22% ~01m 40s      
  |++++++++++++                                      | 23% ~01m 40s      
  |++++++++++++                                      | 24% ~01m 39s      
  |+++++++++++++                                     | 25% ~01m 37s      
  |+++++++++++++                                     | 26% ~01m 35s      
  |++++++++++++++                                    | 27% ~01m 34s      
  |++++++++++++++                                    | 28% ~01m 32s      
  |+++++++++++++++                                   | 29% ~01m 31s      
  |++++++++++++++++                                  | 30% ~01m 30s      
  |++++++++++++++++                                  | 31% ~01m 28s      
  |+++++++++++++++++                                 | 32% ~01m 27s      
  |+++++++++++++++++                                 | 33% ~01m 26s      
  |++++++++++++++++++                                | 34% ~01m 24s      
  |++++++++++++++++++                                | 35% ~01m 23s      
  |+++++++++++++++++++                               | 37% ~01m 21s      
  |+++++++++++++++++++                               | 38% ~01m 20s      
  |++++++++++++++++++++                              | 39% ~01m 18s      
  |++++++++++++++++++++                              | 40% ~01m 17s      
  |+++++++++++++++++++++                             | 41% ~01m 15s      
  |+++++++++++++++++++++                             | 42% ~01m 14s      
  |++++++++++++++++++++++                            | 43% ~01m 13s      
  |+++++++++++++++++++++++                           | 44% ~01m 11s      
  |+++++++++++++++++++++++                           | 45% ~01m 10s      
  |++++++++++++++++++++++++                          | 46% ~01m 09s      
  |++++++++++++++++++++++++                          | 47% ~01m 07s      
  |+++++++++++++++++++++++++                         | 48% ~01m 06s      
  |+++++++++++++++++++++++++                         | 49% ~01m 05s      
  |++++++++++++++++++++++++++                        | 51% ~01m 03s      
  |++++++++++++++++++++++++++                        | 52% ~01m 02s      
  |+++++++++++++++++++++++++++                       | 53% ~01m 01s      
  |+++++++++++++++++++++++++++                       | 54% ~59s          
  |++++++++++++++++++++++++++++                      | 55% ~58s          
  |++++++++++++++++++++++++++++                      | 56% ~57s          
  |+++++++++++++++++++++++++++++                     | 57% ~55s          
  |++++++++++++++++++++++++++++++                    | 58% ~54s          
  |++++++++++++++++++++++++++++++                    | 59% ~52s          
  |+++++++++++++++++++++++++++++++                   | 60% ~51s          
  |+++++++++++++++++++++++++++++++                   | 61% ~50s          
  |++++++++++++++++++++++++++++++++                  | 62% ~48s          
  |++++++++++++++++++++++++++++++++                  | 63% ~47s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~45s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~44s          
  |++++++++++++++++++++++++++++++++++                | 67% ~42s          
  |++++++++++++++++++++++++++++++++++                | 68% ~41s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~40s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~38s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~37s          
  |+++++++++++++++++++++++++++++++++++++             | 72% ~36s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~34s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~33s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~31s          
  |+++++++++++++++++++++++++++++++++++++++           | 76% ~30s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~29s          
  |++++++++++++++++++++++++++++++++++++++++          | 78% ~27s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~26s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~25s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~23s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~22s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~21s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~19s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 86% ~18s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~16s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 88% ~15s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~14s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 90% ~12s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~11s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 92% ~10s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~08s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~07s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~05s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~03s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02m 07s
Calculating cluster 10

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~02m 04s      
  |++                                                | 2 % ~02m 03s      
  |++                                                | 3 % ~02m 02s      
  |+++                                               | 4 % ~02m 00s      
  |+++                                               | 5 % ~01m 57s      
  |++++                                              | 6 % ~01m 58s      
  |++++                                              | 7 % ~01m 56s      
  |+++++                                             | 9 % ~01m 55s      
  |+++++                                             | 10% ~01m 54s      
  |++++++                                            | 11% ~01m 52s      
  |++++++                                            | 12% ~01m 50s      
  |+++++++                                           | 13% ~01m 51s      
  |+++++++                                           | 14% ~01m 49s      
  |++++++++                                          | 15% ~01m 47s      
  |++++++++                                          | 16% ~01m 46s      
  |+++++++++                                         | 17% ~01m 44s      
  |++++++++++                                        | 18% ~01m 42s      
  |++++++++++                                        | 19% ~01m 41s      
  |+++++++++++                                       | 20% ~01m 39s      
  |+++++++++++                                       | 21% ~01m 38s      
  |++++++++++++                                      | 22% ~01m 36s      
  |++++++++++++                                      | 23% ~01m 34s      
  |+++++++++++++                                     | 24% ~01m 33s      
  |+++++++++++++                                     | 26% ~01m 31s      
  |++++++++++++++                                    | 27% ~01m 30s      
  |++++++++++++++                                    | 28% ~01m 29s      
  |+++++++++++++++                                   | 29% ~01m 27s      
  |+++++++++++++++                                   | 30% ~01m 26s      
  |++++++++++++++++                                  | 31% ~01m 24s      
  |++++++++++++++++                                  | 32% ~01m 23s      
  |+++++++++++++++++                                 | 33% ~01m 22s      
  |++++++++++++++++++                                | 34% ~01m 20s      
  |++++++++++++++++++                                | 35% ~01m 19s      
  |+++++++++++++++++++                               | 36% ~01m 18s      
  |+++++++++++++++++++                               | 37% ~01m 16s      
  |++++++++++++++++++++                              | 38% ~01m 15s      
  |++++++++++++++++++++                              | 39% ~01m 14s      
  |+++++++++++++++++++++                             | 40% ~01m 12s      
  |+++++++++++++++++++++                             | 41% ~01m 11s      
  |++++++++++++++++++++++                            | 43% ~01m 10s      
  |++++++++++++++++++++++                            | 44% ~01m 09s      
  |+++++++++++++++++++++++                           | 45% ~01m 07s      
  |+++++++++++++++++++++++                           | 46% ~01m 06s      
  |++++++++++++++++++++++++                          | 47% ~01m 05s      
  |++++++++++++++++++++++++                          | 48% ~01m 04s      
  |+++++++++++++++++++++++++                         | 49% ~01m 02s      
  |+++++++++++++++++++++++++                         | 50% ~01m 01s      
  |++++++++++++++++++++++++++                        | 51% ~60s          
  |+++++++++++++++++++++++++++                       | 52% ~58s          
  |+++++++++++++++++++++++++++                       | 53% ~57s          
  |++++++++++++++++++++++++++++                      | 54% ~56s          
  |++++++++++++++++++++++++++++                      | 55% ~54s          
  |+++++++++++++++++++++++++++++                     | 56% ~53s          
  |+++++++++++++++++++++++++++++                     | 57% ~52s          
  |++++++++++++++++++++++++++++++                    | 59% ~50s          
  |++++++++++++++++++++++++++++++                    | 60% ~49s          
  |+++++++++++++++++++++++++++++++                   | 61% ~48s          
  |+++++++++++++++++++++++++++++++                   | 62% ~46s          
  |++++++++++++++++++++++++++++++++                  | 63% ~45s          
  |++++++++++++++++++++++++++++++++                  | 64% ~44s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~43s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~41s          
  |++++++++++++++++++++++++++++++++++                | 67% ~40s          
  |+++++++++++++++++++++++++++++++++++               | 68% ~39s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~37s          
  |++++++++++++++++++++++++++++++++++++              | 70% ~36s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~35s          
  |+++++++++++++++++++++++++++++++++++++             | 72% ~33s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~32s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~31s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~30s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~29s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~28s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~27s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~25s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~24s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~23s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~21s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 84% ~20s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~19s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 86% ~17s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~16s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 88% ~15s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~13s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 90% ~12s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~11s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~09s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~08s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~07s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~05s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~03s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02m 03s
Calculating cluster 11

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~01m 54s      
  |+                                                 | 2 % ~01m 58s      
  |++                                                | 3 % ~01m 53s      
  |++                                                | 4 % ~01m 55s      
  |+++                                               | 5 % ~01m 56s      
  |+++                                               | 6 % ~01m 53s      
  |++++                                              | 7 % ~01m 52s      
  |++++                                              | 8 % ~01m 52s      
  |+++++                                             | 9 % ~01m 50s      
  |+++++                                             | 10% ~01m 49s      
  |++++++                                            | 11% ~01m 47s      
  |++++++                                            | 12% ~01m 48s      
  |+++++++                                           | 13% ~01m 50s      
  |+++++++                                           | 14% ~01m 50s      
  |++++++++                                          | 15% ~01m 49s      
  |++++++++                                          | 16% ~01m 47s      
  |+++++++++                                         | 17% ~01m 48s      
  |+++++++++                                         | 18% ~01m 46s      
  |++++++++++                                        | 19% ~01m 44s      
  |++++++++++                                        | 20% ~01m 42s      
  |+++++++++++                                       | 21% ~01m 41s      
  |+++++++++++                                       | 22% ~01m 40s      
  |++++++++++++                                      | 23% ~01m 38s      
  |++++++++++++                                      | 24% ~01m 36s      
  |+++++++++++++                                     | 25% ~01m 35s      
  |+++++++++++++                                     | 26% ~01m 33s      
  |++++++++++++++                                    | 27% ~01m 33s      
  |++++++++++++++                                    | 28% ~01m 32s      
  |+++++++++++++++                                   | 29% ~01m 30s      
  |+++++++++++++++                                   | 30% ~01m 28s      
  |++++++++++++++++                                  | 31% ~01m 27s      
  |++++++++++++++++                                  | 32% ~01m 26s      
  |+++++++++++++++++                                 | 33% ~01m 25s      
  |+++++++++++++++++                                 | 34% ~01m 24s      
  |++++++++++++++++++                                | 35% ~01m 23s      
  |++++++++++++++++++                                | 36% ~01m 21s      
  |+++++++++++++++++++                               | 37% ~01m 20s      
  |+++++++++++++++++++                               | 38% ~01m 18s      
  |++++++++++++++++++++                              | 39% ~01m 17s      
  |++++++++++++++++++++                              | 40% ~01m 16s      
  |+++++++++++++++++++++                             | 41% ~01m 14s      
  |+++++++++++++++++++++                             | 42% ~01m 13s      
  |++++++++++++++++++++++                            | 43% ~01m 12s      
  |++++++++++++++++++++++                            | 44% ~01m 10s      
  |+++++++++++++++++++++++                           | 45% ~01m 09s      
  |+++++++++++++++++++++++                           | 46% ~01m 08s      
  |++++++++++++++++++++++++                          | 47% ~01m 06s      
  |++++++++++++++++++++++++                          | 48% ~01m 05s      
  |+++++++++++++++++++++++++                         | 49% ~01m 04s      
  |+++++++++++++++++++++++++                         | 50% ~01m 03s      
  |++++++++++++++++++++++++++                        | 51% ~01m 01s      
  |++++++++++++++++++++++++++                        | 52% ~60s          
  |+++++++++++++++++++++++++++                       | 53% ~59s          
  |+++++++++++++++++++++++++++                       | 54% ~57s          
  |++++++++++++++++++++++++++++                      | 55% ~56s          
  |++++++++++++++++++++++++++++                      | 56% ~55s          
  |+++++++++++++++++++++++++++++                     | 57% ~54s          
  |+++++++++++++++++++++++++++++                     | 58% ~52s          
  |++++++++++++++++++++++++++++++                    | 59% ~51s          
  |++++++++++++++++++++++++++++++                    | 60% ~50s          
  |+++++++++++++++++++++++++++++++                   | 61% ~48s          
  |+++++++++++++++++++++++++++++++                   | 62% ~47s          
  |++++++++++++++++++++++++++++++++                  | 63% ~46s          
  |++++++++++++++++++++++++++++++++                  | 64% ~44s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~43s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~42s          
  |++++++++++++++++++++++++++++++++++                | 67% ~41s          
  |++++++++++++++++++++++++++++++++++                | 68% ~39s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~38s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~37s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~36s          
  |++++++++++++++++++++++++++++++++++++              | 72% ~34s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~33s          
  |+++++++++++++++++++++++++++++++++++++             | 74% ~32s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~31s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~29s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~28s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~27s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~26s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~24s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~23s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~22s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~21s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~20s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~18s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 86% ~17s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~16s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 88% ~15s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~13s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~12s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~11s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 92% ~10s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~09s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~07s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~06s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~05s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02m 01s
library(enrichR)
Welcome to enrichR
Checking connection ... 
Enrichr ... Connection is Live!
FlyEnrichr ... Connection is available!
WormEnrichr ... Connection is available!
YeastEnrichr ... Connection is available!
FishEnrichr ... Connection is available!
OxEnrichr ... Connection is available!
setEnrichrSite("Enrichr") # Human genes
Connection changed to https://maayanlab.cloud/Enrichr/
Connection is Live!
# list of all the databases
# get the possible libraries
dbs <- listEnrichrDbs()

# this will list the possible libraries
dbs

# select libraries with cell types
db <- c('CellMarker_Augmented_2021','Azimuth_Cell_Types_2021')

# function for a quick look
checkCelltypes <- function(cluster_num = 0){
  clusterX <- ClusterMarkers %>% filter(cluster == cluster_num & avg_log2FC > 0.25)
  genes <- clusterX$gene
  # the cell type libraries
  # get the results for each library
  clusterX.cell <- enrichr(genes, databases = db)
  # visualize the results
print(plotEnrich(clusterX.cell[[1]], showTerms = 20, numChar = 40, y = "Count", orderBy = "P.value", title = 'CellMarker_Augmented_2021'))
print(plotEnrich(clusterX.cell[[2]], showTerms = 20, numChar = 40, y = "Count", orderBy = "P.value", title = 'Azimuth_Cell_Types_2021'))

}

Plot top markers

DoHeatmap(seu, features = top2$gene, size = 3, angle = 90, group.by = "integrated_snn_res.0.3")
Error in DoHeatmap(seu, features = top2$gene, size = 3, angle = 90, group.by = "integrated_snn_res.0.3") : 
  No requested features found in the scale.data slot for the RNA assay.

Quick look

checkCelltypes(cluster_num = 11)
Uploading data to Enrichr... Done.
  Querying CellMarker_Augmented_2021... Done.
  Querying Azimuth_Cell_Types_2021... Done.
Parsing results... Done.

Add cell types - fine resolution

Save this object.

Now get the aggregated data for differential expression

To run DGE we need to make the meta data table

library(DESeq2)

# Create an empty list to store the results for each cell type
list.results <- vector("list", length(Celltypes))

# Loop through each cell type and perform DESeq analysis
for (i in seq_along(Celltypes)) {
  # Subset the expression dataframe by the current cell type
  print(Celltypes[i])
  df_sub <- df.trans[grepl(paste0("^", Celltypes[i], "_"), rownames(df.trans)), ]
  print(dim(df_sub))
  # test one cell group
  #i = "NPC-div"
  df.meta_sub <- df.meta[df.meta$Celltype == Celltypes[i], ]
  print(dim(df.meta_sub))
  # Prepare the DESeq object
  dft <- as.data.frame(t(df_sub)) # Transpose the subset dataframe to get genes as rows and samples as columns
  dfi <- lapply(dft, as.integer)
  dfi <- as.data.frame(dfi)
  rownames(dfi) <- rownames(dft)
  # Create the DESeqDataSet object using the subset dataframe and metadata
  dds <- DESeqDataSetFromMatrix(countData = dfi, colData = df.meta_sub, design = ~DiseaseStatus)
  # Perform DESeq analysis
  dds <- DESeq(dds)
  # Store the DESeq results in the list with the cell type as the list index
  res <- results(dds)
  list2 <- list()
  list2[["dds"]] <- dds
  list2[["results"]] <- res
  
  # Initialize an empty list to store the results for each contrast
  all_results <- list()
  # Loop through each contrast and calculate the results
  for (j in 1:(length(all_contrasts) - 1)) {
    for (k in (j + 1):length(all_contrasts)) {
      contrast_level1 <- all_contrasts[j]
      contrast_level2 <- all_contrasts[k]
      
      # Check if both levels have at least one sample
      if (any(dds$DiseaseStatus %in% c(contrast_level1, contrast_level2))) {
        # Check if contrast levels are different
        if (contrast_level1 != contrast_level2) {
          contrast_name <- paste("DiseaseStatus", contrast_level1, "vs", contrast_level2)
          # Filter rows with complete cases for the current contrast levels
          complete_cases <- complete.cases(dds$DiseaseStatus, dds$DiseaseStatus %in% c(contrast_level1, contrast_level2))
          # Subset the DESeq object and calculate the contrast results
          dds_sub <- dds[complete_cases, ]
          
          # Check if both levels still exist in the subset after removing missing values
          if (contrast_level1 %in% unique(dds_sub$DiseaseStatus) && contrast_level2 %in% unique(dds_sub$DiseaseStatus)) {
            contrast_result <- results(dds_sub, contrast = c("DiseaseStatus", contrast_level1, contrast_level2), name = contrast_name)
            all_results[[contrast_name]] <- contrast_result
          } else {
            message(paste("Skipping", contrast_name, "due to missing contrast levels in DiseaseStatus."))
          }
        } else {
          message(paste("Skipping", contrast_level1, "vs", contrast_level2, "since they are the same level."))
        }
      }
    }
  }
  
  # Add the contrast results to the list
  list2[["contrast_results"]] <- all_results
  
  # Store the list for the current cell type in the appropriate slot
  list.results[[i]] <- list2
}
[1] "NPC-div"
[1]    22 58395
[1] 22  4
Warning in DESeqDataSet(se, design = design, ignoreRank) :
  some variables in design formula are characters, converting to factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating size factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
final dispersion estimates
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
-- replacing outliers and refitting for 52 genes
-- DESeq argument 'minReplicatesForReplace' = 7 
-- original counts are preserved in counts(dds)
estimating dispersions
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
[1] "NeuronGABA"
[1]    22 58395
[1] 22  4
Warning in DESeqDataSet(se, design = design, ignoreRank) :
  some variables in design formula are characters, converting to factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating size factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
final dispersion estimates
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
-- replacing outliers and refitting for 72 genes
-- DESeq argument 'minReplicatesForReplace' = 7 
-- original counts are preserved in counts(dds)
estimating dispersions
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
[1] "Progenitor"
[1]    21 58395
[1] 21  4
Warning in DESeqDataSet(se, design = design, ignoreRank) :
  some variables in design formula are characters, converting to factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating size factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
final dispersion estimates
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
-- replacing outliers and refitting for 35 genes
-- DESeq argument 'minReplicatesForReplace' = 7 
-- original counts are preserved in counts(dds)
estimating dispersions
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
[1] "Epithelial"
[1]    21 58395
[1] 21  4
Warning in DESeqDataSet(se, design = design, ignoreRank) :
  some variables in design formula are characters, converting to factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating size factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
final dispersion estimates
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
-- replacing outliers and refitting for 82 genes
-- DESeq argument 'minReplicatesForReplace' = 7 
-- original counts are preserved in counts(dds)
estimating dispersions
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
[1] "NPC-DA"
[1]    21 58395
[1] 21  4
Warning in DESeqDataSet(se, design = design, ignoreRank) :
  some variables in design formula are characters, converting to factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating size factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
final dispersion estimates
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
-- replacing outliers and refitting for 154 genes
-- DESeq argument 'minReplicatesForReplace' = 7 
-- original counts are preserved in counts(dds)
estimating dispersions
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
[1] "NeuronDA"
[1]    22 58395
[1] 22  4
Warning in DESeqDataSet(se, design = design, ignoreRank) :
  some variables in design formula are characters, converting to factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating size factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
final dispersion estimates
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
-- replacing outliers and refitting for 171 genes
-- DESeq argument 'minReplicatesForReplace' = 7 
-- original counts are preserved in counts(dds)
estimating dispersions
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
[1] "Neuron"
[1]    16 58395
[1] 16  4
Warning in DESeqDataSet(se, design = design, ignoreRank) :
  some variables in design formula are characters, converting to factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating size factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
final dispersion estimates
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
-- replacing outliers and refitting for 54 genes
-- DESeq argument 'minReplicatesForReplace' = 7 
-- original counts are preserved in counts(dds)
estimating dispersions
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
[1] "Stem"
[1]    17 58395
[1] 17  4
Warning in DESeqDataSet(se, design = design, ignoreRank) :
  some variables in design formula are characters, converting to factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating size factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
final dispersion estimates
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
-- replacing outliers and refitting for 48 genes
-- DESeq argument 'minReplicatesForReplace' = 7 
-- original counts are preserved in counts(dds)
estimating dispersions
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
[1] "Endothelial"
[1]     8 58395
[1] 8 4
Warning in DESeqDataSet(se, design = design, ignoreRank) :
  some variables in design formula are characters, converting to factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating size factors
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
final dispersion estimates
  Note: levels of factors in the design contain characters other than
  letters, numbers, '_' and '.'. It is recommended (but not required) to use
  only letters, numbers, and delimiters '_' or '.', as these are safe characters
  for column names in R. [This is a message, not a warning or an error]
fitting model and testing

Same loop that should add the cell type names

# Create an empty list to store the results for each cell type
list.results <- setNames(vector("list", length(Celltypes)), Celltypes)

# Loop through each cell type and perform DESeq analysis
for (i in seq_along(Celltypes)) {
  # Subset the expression dataframe by the current cell type
  print(Celltypes[i])
  df_sub <- df.trans[grepl(paste0("^", Celltypes[i], "_"), rownames(df.trans)), ]
  print(dim(df_sub))
  # test one cell group
  #i = "NPC-div"
  df.meta_sub <- df.meta[df.meta$Celltype == Celltypes[i], ]
  print(dim(df.meta_sub))
  # Prepare the DESeq object
  dft <- as.data.frame(t(df_sub)) # Transpose the subset dataframe to get genes as rows and samples as columns
  dfi <- lapply(dft, as.integer)
  dfi <- as.data.frame(dfi)
  rownames(dfi) <- rownames(dft)
  # Create the DESeqDataSet object using the subset dataframe and metadata
  dds <- DESeqDataSetFromMatrix(countData = dfi, colData = df.meta_sub, design = ~DiseaseStatus)
  # Perform DESeq analysis
  dds <- DESeq(dds)
  # Store the DESeq results in the list with the cell type as the list index
  res <- results(dds)
  list2 <- list()
  list2[["dds"]] <- dds
  list2[["results"]] <- res
  
  # Initialize an empty list to store the results for each contrast
  all_results <- list()
  # Loop through each contrast and calculate the results
  for (j in 1:(length(all_contrasts) - 1)) {
    for (k in (j + 1):length(all_contrasts)) {
      contrast_level1 <- all_contrasts[j]
      contrast_level2 <- all_contrasts[k]
      
      # Check if both levels have at least one sample
      if (any(dds$DiseaseStatus %in% c(contrast_level1, contrast_level2))) {
        # Check if contrast levels are different
        if (contrast_level1 != contrast_level2) {
          contrast_name <- paste("DiseaseStatus", contrast_level1, "vs", contrast_level2)
          # Filter rows with complete cases for the current contrast levels
          complete_cases <- complete.cases(dds$DiseaseStatus, dds$DiseaseStatus %in% c(contrast_level1, contrast_level2))
          # Subset the DESeq object and calculate the contrast results
          dds_sub <- dds[complete_cases, ]
          
          # Check if both levels still exist in the subset after removing missing values
          if (contrast_level1 %in% unique(dds_sub$DiseaseStatus) && contrast_level2 %in% unique(dds_sub$DiseaseStatus)) {
            contrast_result <- results(dds_sub, contrast = c("DiseaseStatus", contrast_level1, contrast_level2), name = contrast_name)
            all_results[[contrast_name]] <- contrast_result
          } else {
            message(paste("Skipping", contrast_name, "due to missing contrast levels in DiseaseStatus."))
          }
        } else {
          message(paste("Skipping", contrast_level1, "vs", contrast_level2, "since they are the same level."))
        }
      }
    }
  }
  
  # Add the contrast results to the list
  list2[["contrast_results"]] <- all_results
  
  # Store the list for the current cell type in the appropriate slot with the cell type name
  list.results[[Celltypes[i]]] <- list2
}
# Create an empty list to store the results for each cell type and contrast
# Create an empty list to store the results for each cell type
list.results <- list()
# Loop through each cell type and perform DESeq analysis
# Create an empty list to store the results for each cell type
list.results <- vector("list", length(Celltypes))

# Loop through each cell type and perform DESeq analysis
for (i in seq_along(Celltypes)) {
  # ... (your previous code to subset and prepare the DESeq object)

  # Initialize an empty list to store the results for each contrast
  all_results <- list()
  # Loop through each contrast and calculate the results
  for (i in 1:(length(all_contrasts) - 1)) {
    for (j in (i + 1):length(all_contrasts)) {
      contrast_level1 <- all_contrasts[i]
      contrast_level2 <- all_contrasts[j]

      # Check if both levels have at least one sample
      if (any(dds$DiseaseStatus %in% c(contrast_level1, contrast_level2))) {
        # Check if contrast levels are different
        if (contrast_level1 != contrast_level2) {
          contrast_name <- paste("DiseaseStatus", contrast_level1, "vs", contrast_level2)
          # Filter rows with complete cases for the current contrast levels
          complete_cases <- complete.cases(dds$DiseaseStatus, dds$DiseaseStatus %in% c(contrast_level1, contrast_level2))
          # Subset the DESeq object and calculate the contrast results
          dds_sub <- dds[complete_cases, ]

          # Check if both levels still exist in the subset after removing missing values
          if (contrast_level1 %in% unique(dds_sub$DiseaseStatus) && contrast_level2 %in% unique(dds_sub$DiseaseStatus)) {
            contrast_result <- results(dds_sub, contrast = c("DiseaseStatus", contrast_level1, contrast_level2), name = contrast_name)
            all_results[[contrast_name]] <- contrast_result
          } else {
            message(paste("Skipping", contrast_name, "due to missing contrast levels in DiseaseStatus."))
          }
        } else {
          message(paste("Skipping", contrast_level1, "vs", contrast_level2, "since they are the same level."))
        }
      }
    }
  }

  # Store the DESeq results and objects in the list
  list.results[[i]] <- list(
    dds = dds,
    results = all_results
  )
}

Summarize the DGEs

print(summary_table)

#"/Users/rhalenathomas/Documents/Data/scRNAseq/ParseExample/Experiment1-mini12/SumCounts_NPC_from48sample.csv"
write.csv(summary_table,"/Users/rhalenathomas/Documents/Data/scRNAseq/ParseExample/Experiment1-mini12/DGE_summary_counts_NPCcultures.csv")
saveRDS(list.results, "/Users/rhalenathomas/Documents/Data/scRNAseq/ParseExample/Experiment1-mini12/DGE_NPCculturesList.RDS")
library(EnhancedVolcano)
EnhancedVolcano(res.NPC,
    lab = rownames(res.NPC),
    x = 'log2FoldChange',
    y = 'pvalue',
    #ylim = c(0,20),
    #xlim = c(-2,2),
    pCutoff = 0.001,
    FCcutoff = 1,
    pointSize = 5.0,
    labSize = 5, 
    #legendLabSize = 20,
    #subtitleLabSize = 20,
    #legendIconSize = 10,
    ) 

LS0tCnRpdGxlOiAiUiBOb3RlYm9vayIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQoKYGBge3J9CmxpYnJhcnkoU2V1cmF0KQpsaWJyYXJ5KHRpZHl2ZXJzZSkKI2xpYnJhcnkoQ2VsbHR5cGVSKQpgYGAKCgoKYGBge3J9CnNldSA8LSByZWFkUkRTKCIvVXNlcnMvcmhhbGVuYXRob21hcy9Eb2N1bWVudHMvRGF0YS9zY1JOQXNlcS9QYXJzZUV4YW1wbGUvRXgyXzQ4d2VsbC9QYXJzZTQ4X2FuYWx5c2lzTWFyaWEuUkRTIikKCnVuaXF1ZShzZXUkc2FtcGxlKQoKSWRlbnRzKHNldSkgPC0gInNhbXBsZSIKbGV2ZWxzKHNldSkKCnNhbXBsZXMgPC0gbGV2ZWxzKHNldSkKc2FtcGxlcwoKYGBgCgpBZGQgbWV0YSBkYXRhIGluZm9ybWF0aW9uC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pbmVfdmVjdG9yW25ld19saW5lX3ZlY3RvciA9PSAiUTY1USJdIDwtICIzMTIzLWlzb1E2NVEiCgojIFByaW50IHRoZSBuZXcgdmVjdG9yIHdpdGggbGluZSBuYW1lcwoKCm5ld19saW5lX3ZlY3RvcltuZXdfbGluZV92ZWN0b3IgPT0gIjJBSVcwMDItMDIiXSA8LSAiQUlXMDAyLTAyIgoKcHJpbnQobmV3X2xpbmVfdmVjdG9yKQoKc2V1IDwtIGFubm90YXRlKHNldSwgYW5ub3RhdGlvbnMgPSBuZXdfbGluZV92ZWN0b3IsIHRvX2xhYmVsID0gInNhbXBsZSIsYW5ub3RhdGlvbl9uYW1lID0gIkxpbmUiKQoKCiMgY2hlY2sKdGFibGUoc2V1JHNhbXBsZSwgc2V1JExpbmUpCgpgYGAKYGBge3IsIGZpZy53aWR0aD02fQpEaW1QbG90KHNldSkKYGBgCgoKYGBge3J9CiMgYWRkIGRpc2Vhc2Ugc3RhdHVzCgojIENyZWF0ZSB0aGUgbG9va3VwIHRhYmxlIGZvciBMaW5lIHRvIERpc2Vhc2VTdGF0dXMgbWFwcGluZwpsaW5lX3RvX2Rpc2Vhc2UgPC0gYygiMzQ0OCIgPSAiSEMiLAogICAgICAgICAgICAgICAgICAgICAiVEQyMiIgPSAiSEMiLAogICAgICAgICAgICAgICAgICAgICAiQUlXMDAxLTAyIiA9ICJIQyIsCiAgICAgICAgICAgICAgICAgICAgICJBSVcwMDItMDIiID0gIkhDIiwKICAgICAgICAgICAgICAgICAgICAgIjI5NjUiID0gIlBEIiwKICAgICAgICAgICAgICAgICAgICAgIjMzODMiID0gIlBEIiwKICAgICAgICAgICAgICAgICAgICAgIjM1NzUiID0gIlBEIiwKICAgICAgICAgICAgICAgICAgICAgIlREMDYiID0gIlBEIiwKICAgICAgICAgICAgICAgICAgICAgIlREMDciID0gIlBEIiwKICAgICAgICAgICAgICAgICAgICAgIjMxMjMiID0gIlBEIiwKICAgICAgICAgICAgICAgICAgICAgIjM1NjciID0gIlBEIiwKICAgICAgICAgICAgICAgICAgICAgIjM1OTUiID0gIlBEIiwKICAgICAgICAgICAgICAgICAgICAgIjM5NDAiID0gIlBEIiwKICAgICAgICAgICAgICAgICAgICAgIjM1NjctaXNvIiA9ICJQRC1pc28iLAogICAgICAgICAgICAgICAgICAgICAiMzk0MFItaXNvIiA9ICJQRC1pc28iLAogICAgICAgICAgICAgICAgICAgICAiVEQwNi1pc28iID0gIlBELWlzbyIsCiAgICAgICAgICAgICAgICAgICAgICIzOTQwTi1pc28iID0gIlBELWlzbyIsCiAgICAgICAgICAgICAgICAgICAgICIzMTIzLWlzb1E2NVEiID0gIlBELWlzbyIsCiAgICAgICAgICAgICAgICAgICAgICIzMTIzLWlzb1A2NVAiID0gIlBELWlzbyIsCiAgICAgICAgICAgICAgICAgICAgICIzMTIzLWlzbyIgPSAiUEQtaXNvIiwKICAgICAgICAgICAgICAgICAgICAgIjMzODMtaXNvIiA9ICJQRC1pc28iLAogICAgICAgICAgICAgICAgICAgICAiMzU3NS1pc28iID0gIlBELWlzbyIsCiAgICAgICAgICAgICAgICAgICAgICIzNTk1LWlzbyIgPSAiUEQtaXNvIikKCiMgQXNzdW1pbmcgIkxpbmUiIGlzIHlvdXIgc3RhcnRpbmcgY2hhcmFjdGVyIHZlY3RvcgpJZGVudHMoc2V1KSA8LSAiTGluZSIKTGluZSA8LSBsZXZlbHMoc2V1KQojIENyZWF0ZSBhIG5ldyB2ZWN0b3Igb2YgZGlzZWFzZSBzdGF0dXNlcyB1c2luZyB0aGUgbG9va3VwIHRhYmxlCmRpc2Vhc2Vfc3RhdHVzX3ZlY3RvciA8LSBpZmVsc2UoTGluZSAlaW4lIG5hbWVzKGxpbmVfdG9fZGlzZWFzZSksIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVfdG9fZGlzZWFzZVtMaW5lXSwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm90aGVyIikKCiMgUHJpbnQgdGhlIG5ldyB2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